remove another error suffix
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit
This commit is contained in:
parent
4969d6c33c
commit
e3d2d88538
@ -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<ByteConversionError> for PusError {
|
||||
fn from(e: ByteConversionError) -> Self {
|
||||
PusError::ByteConversionError(e)
|
||||
PusError::ByteConversion(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user