From 6a9bd8135d3989e8eb43db9964113ac3d2ba1aef Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Jan 2023 21:57:45 +0100 Subject: [PATCH] fixes for clippy 1.67 --- src/ecss.rs | 9 ++++----- src/time/cds.rs | 5 ++--- src/time/cuc.rs | 8 ++++---- src/time/mod.rs | 11 +++++------ 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/ecss.rs b/src/ecss.rs index b597476..fdc3e04 100644 --- a/src/ecss.rs +++ b/src/ecss.rs @@ -122,16 +122,15 @@ impl Display for PusError { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { PusError::VersionNotSupported(v) => { - write!(f, "PUS version {:?} not supported", v) + write!(f, "PUS version {v:?} not supported") } PusError::IncorrectCrc(crc) => { - write!(f, "crc16 {:#04x} is incorrect", crc) + write!(f, "crc16 {crc:#04x} is incorrect") } PusError::RawDataTooShort(size) => { write!( f, - "deserialization error, provided raw data with size {} too short", - size + "deserialization error, provided raw data with size {size} too short" ) } PusError::NoRawData => { @@ -141,7 +140,7 @@ impl Display for PusError { write!(f, "crc16 was not calculated") } PusError::ByteConversionError(e) => { - write!(f, "low level byte conversion error: {}", e) + write!(f, "low level byte conversion error: {e}") } } } diff --git a/src/time/cds.rs b/src/time/cds.rs index 6fb0e2c..b42361d 100644 --- a/src/time/cds.rs +++ b/src/time/cds.rs @@ -84,13 +84,12 @@ impl Display for CdsError { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { CdsError::InvalidCcsdsDays(days) => { - write!(f, "invalid ccsds days {}", days) + write!(f, "invalid ccsds days {days}") } CdsError::InvalidCtorForDaysOfLenInPreamble(length_of_day) => { write!( f, - "wrong constructor for length of day {:?} detected in preamble", - length_of_day + "wrong constructor for length of day {length_of_day:?} detected in preamble", ) } } diff --git a/src/time/cuc.rs b/src/time/cuc.rs index 9790afb..95fd01e 100644 --- a/src/time/cuc.rs +++ b/src/time/cuc.rs @@ -103,16 +103,16 @@ impl Display for CucError { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { CucError::InvalidCounterWidth(w) => { - write!(f, "invalid cuc counter byte width {}", w) + write!(f, "invalid cuc counter byte width {w}") } CucError::InvalidFractionResolution(w) => { - write!(f, "invalid cuc fractional part byte width {:?}", w) + write!(f, "invalid cuc fractional part byte width {w:?}") } CucError::InvalidCounter(w, c) => { - write!(f, "invalid cuc counter {} for width {}", c, w) + write!(f, "invalid cuc counter {c} for width {w}") } CucError::InvalidFractions(w, c) => { - write!(f, "invalid cuc fractional part {} for width {:?}", c, w) + write!(f, "invalid cuc fractional part {c} for width {w:?}") } } } diff --git a/src/time/mod.rs b/src/time/mod.rs index 57081b2..90f23ac 100644 --- a/src/time/mod.rs +++ b/src/time/mod.rs @@ -111,21 +111,20 @@ impl Display for TimestampError { TimestampError::InvalidTimeCode(time_code, raw_val) => { write!( f, - "invalid raw time code value {} for time code {:?}", - raw_val, time_code + "invalid raw time code value {raw_val} for time code {time_code:?}" ) } TimestampError::CdsError(e) => { - write!(f, "cds error {}", e) + write!(f, "cds error {e}") } TimestampError::CucError(e) => { - write!(f, "cuc error {}", e) + write!(f, "cuc error {e}") } TimestampError::ByteConversionError(e) => { - write!(f, "byte conversion error {}", e) + write!(f, "byte conversion error {e}") } TimestampError::DateBeforeCcsdsEpoch(e) => { - write!(f, "datetime with date before ccsds epoch: {}", e) + write!(f, "datetime with date before ccsds epoch: {e}") } TimestampError::CustomEpochNotSupported => { write!(f, "custom epochs are not supported")