From e2452a8da18ac1fc83e26687406537e6d937fd56 Mon Sep 17 00:00:00 2001 From: Liam Kinne Date: Thu, 5 Sep 2024 14:34:25 +1000 Subject: [PATCH] cleanup --- src/command.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/command.rs b/src/command.rs index 4b777be..657f4d7 100644 --- a/src/command.rs +++ b/src/command.rs @@ -88,19 +88,19 @@ pub enum SendDataError { ModuleBusy, /// Payload too long. PayloadInvalid, - /// Unrecognised error response. - Other(u8), + /// Error code not recognised by this library. + Unknown(u8), } impl From for SendDataError { fn from(value: u8) -> Self { match value { - 0x01 => SendDataError::AckTimeout, - 0x02 => SendDataError::InvalidChannel, - 0x03 => SendDataError::ChannelBusy, - 0x04 => SendDataError::ModuleBusy, - 0xFF => SendDataError::PayloadInvalid, - _ => SendDataError::Other(value), + 0x01 => Self::AckTimeout, + 0x02 => Self::InvalidChannel, + 0x03 => Self::ChannelBusy, + 0x04 => Self::ModuleBusy, + 0xFF => Self::PayloadInvalid, + _ => Self::Unknown(value), } } }