fixes for clippy 1.67
Rust/spacepackets/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2023-01-26 21:57:45 +01:00
parent b6df5fb4d1
commit 6a9bd8135d
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
4 changed files with 15 additions and 18 deletions

View File

@ -122,16 +122,15 @@ impl Display for PusError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self { match self {
PusError::VersionNotSupported(v) => { PusError::VersionNotSupported(v) => {
write!(f, "PUS version {:?} not supported", v) write!(f, "PUS version {v:?} not supported")
} }
PusError::IncorrectCrc(crc) => { PusError::IncorrectCrc(crc) => {
write!(f, "crc16 {:#04x} is incorrect", crc) write!(f, "crc16 {crc:#04x} is incorrect")
} }
PusError::RawDataTooShort(size) => { PusError::RawDataTooShort(size) => {
write!( write!(
f, f,
"deserialization error, provided raw data with size {} too short", "deserialization error, provided raw data with size {size} too short"
size
) )
} }
PusError::NoRawData => { PusError::NoRawData => {
@ -141,7 +140,7 @@ impl Display for PusError {
write!(f, "crc16 was not calculated") write!(f, "crc16 was not calculated")
} }
PusError::ByteConversionError(e) => { PusError::ByteConversionError(e) => {
write!(f, "low level byte conversion error: {}", e) write!(f, "low level byte conversion error: {e}")
} }
} }
} }

View File

@ -84,13 +84,12 @@ impl Display for CdsError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self { match self {
CdsError::InvalidCcsdsDays(days) => { CdsError::InvalidCcsdsDays(days) => {
write!(f, "invalid ccsds days {}", days) write!(f, "invalid ccsds days {days}")
} }
CdsError::InvalidCtorForDaysOfLenInPreamble(length_of_day) => { CdsError::InvalidCtorForDaysOfLenInPreamble(length_of_day) => {
write!( write!(
f, f,
"wrong constructor for length of day {:?} detected in preamble", "wrong constructor for length of day {length_of_day:?} detected in preamble",
length_of_day
) )
} }
} }

View File

@ -103,16 +103,16 @@ impl Display for CucError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self { match self {
CucError::InvalidCounterWidth(w) => { CucError::InvalidCounterWidth(w) => {
write!(f, "invalid cuc counter byte width {}", w) write!(f, "invalid cuc counter byte width {w}")
} }
CucError::InvalidFractionResolution(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) => { 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) => { CucError::InvalidFractions(w, c) => {
write!(f, "invalid cuc fractional part {} for width {:?}", c, w) write!(f, "invalid cuc fractional part {c} for width {w:?}")
} }
} }
} }

View File

@ -111,21 +111,20 @@ impl Display for TimestampError {
TimestampError::InvalidTimeCode(time_code, raw_val) => { TimestampError::InvalidTimeCode(time_code, raw_val) => {
write!( write!(
f, f,
"invalid raw time code value {} for time code {:?}", "invalid raw time code value {raw_val} for time code {time_code:?}"
raw_val, time_code
) )
} }
TimestampError::CdsError(e) => { TimestampError::CdsError(e) => {
write!(f, "cds error {}", e) write!(f, "cds error {e}")
} }
TimestampError::CucError(e) => { TimestampError::CucError(e) => {
write!(f, "cuc error {}", e) write!(f, "cuc error {e}")
} }
TimestampError::ByteConversionError(e) => { TimestampError::ByteConversionError(e) => {
write!(f, "byte conversion error {}", e) write!(f, "byte conversion error {e}")
} }
TimestampError::DateBeforeCcsdsEpoch(e) => { TimestampError::DateBeforeCcsdsEpoch(e) => {
write!(f, "datetime with date before ccsds epoch: {}", e) write!(f, "datetime with date before ccsds epoch: {e}")
} }
TimestampError::CustomEpochNotSupported => { TimestampError::CustomEpochNotSupported => {
write!(f, "custom epochs are not supported") write!(f, "custom epochs are not supported")