diff --git a/src/ecss/mod.rs b/src/ecss/mod.rs index add2d24..acf04b5 100644 --- a/src/ecss/mod.rs +++ b/src/ecss/mod.rs @@ -149,7 +149,7 @@ pub enum PusError { NoRawData, /// CRC16 needs to be calculated first CrcCalculationMissing, - ByteConversionError(ByteConversionError), + ByteConversion(ByteConversionError), } impl Display for PusError { @@ -173,7 +173,7 @@ impl Display for PusError { PusError::CrcCalculationMissing => { write!(f, "crc16 was not calculated") } - PusError::ByteConversionError(e) => { + PusError::ByteConversion(e) => { write!(f, "low level byte conversion error: {e}") } } @@ -183,7 +183,7 @@ impl Display for PusError { #[cfg(feature = "std")] impl Error for PusError { fn source(&self) -> Option<&(dyn Error + 'static)> { - if let PusError::ByteConversionError(e) = self { + if let PusError::ByteConversion(e) = self { return Some(e); } None @@ -192,7 +192,7 @@ impl Error for PusError { impl From for PusError { fn from(e: ByteConversionError) -> Self { - PusError::ByteConversionError(e) + PusError::ByteConversion(e) } } diff --git a/src/tc.rs b/src/tc.rs index 84e7f09..42a85fb 100644 --- a/src/tc.rs +++ b/src/tc.rs @@ -659,7 +659,7 @@ mod tests { assert!(res.is_err()); let err = res.unwrap_err(); match err { - PusError::ByteConversionError(err) => match err { + PusError::ByteConversion(err) => match err { ByteConversionError::ToSliceTooSmall(missmatch) => { assert_eq!(missmatch.expected, pus_tc.len_packed()); assert_eq!(missmatch.found, 12); diff --git a/src/tm.rs b/src/tm.rs index 5e1fc69..8a0d28d 100644 --- a/src/tm.rs +++ b/src/tm.rs @@ -686,9 +686,9 @@ mod tests { let res = pus_tm.write_to_bytes(&mut buf); assert!(res.is_err()); let error = res.unwrap_err(); - assert!(matches!(error, PusError::ByteConversionError { .. })); + assert!(matches!(error, PusError::ByteConversion { .. })); match error { - PusError::ByteConversionError(err) => match err { + PusError::ByteConversion(err) => match err { ByteConversionError::ToSliceTooSmall(size_missmatch) => { assert_eq!(size_missmatch.expected, 22); assert_eq!(size_missmatch.found, 16);