Change MessageId to u32 instead of String.

main
Laurent Pelecq 2 years ago
parent 3e1a2e0cdc
commit 1a2e7fc145

@ -69,7 +69,7 @@ pub enum Request {
GetPitch,
SetVolume(ClientScope, i8),
GetVolume,
SetPauseContext(ClientScope, u16),
SetPauseContext(ClientScope, u32),
SetNotification(NotificationType, bool),
// Blocks
Begin,
@ -305,6 +305,7 @@ impl<S: Read + Write + Source> Client<S> {
Request::HistoryCursorGet => panic!("not implemented"),
Request::HistoryCursorSet(_scope, _pos) => panic!("not implemented"),
Request::HistoryCursorMove(_direction) => panic!("not implemented"),
Request::HistorySpeak(_id) => panic!("not implemented"),
Request::HistorySort(_direction, _key) => panic!("not implemented"),
Request::HistorySetShortMsgLength(_length) => panic!("not implemented"),
Request::HistorySetMsgTypeOrdering(_ordering) => panic!("not implemented"),

@ -18,7 +18,7 @@ use strum_macros::Display as StrumDisplay;
pub type ReturnCode = u16;
/// Message identifier
pub type MessageId = String;
pub type MessageId = u32;
/// Client identifier
pub type ClientId = String;
@ -549,9 +549,6 @@ mod tests {
fn format_message_scope() {
assert_eq!("self", format!("{}", MessageScope::Last).as_str());
assert_eq!("all", format!("{}", MessageScope::All).as_str());
assert_eq!(
"123",
format!("{}", MessageScope::Message("123".to_string())).as_str()
);
assert_eq!("123", format!("{}", MessageScope::Message(123)).as_str());
}
}

@ -81,7 +81,7 @@ fn say_one_line() -> ClientResult<()> {
],
|client| {
assert_eq!(
"21",
21,
client
.speak()
.unwrap()
@ -374,7 +374,7 @@ fn receive_notification() -> ClientResult<()> {
],
|client| {
assert_eq!(
"21",
21,
client
.speak()
.unwrap()

Loading…
Cancel
Save