diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/commands.rs b/src/commands.rs index d2769ed..e8e332b 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -3,8 +3,8 @@ use core::default::Default; -use serde::{Deserialize, Serialize}; use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; use crate::device::CommandStatus; @@ -28,12 +28,10 @@ trait Command { // TODO: better error if (de-)serialization fails if let Ok((request, _)) = ssmarshal::deserialize::<Self::Request>(data) { match Self::execute(request) { - Ok(response) => { - match ssmarshal::serialize(buf, &response) { - Ok(_) => CommandStatus::Ok, - Err(_) => CommandStatus::NotSupported, - } - } + Ok(response) => match ssmarshal::serialize(buf, &response) { + Ok(_) => CommandStatus::Ok, + Err(_) => CommandStatus::NotSupported, + }, Err(status) => status, } } else { |