clippy fixes
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
3fb2873b91
commit
9d62d66987
@ -210,8 +210,7 @@ pub(crate) fn crc_from_raw_data(raw_data: &[u8]) -> Result<u16, ByteConversionEr
|
||||
return Err(ByteConversionError::FromSliceTooSmall {
|
||||
found: raw_data.len(),
|
||||
expected: 2,
|
||||
}
|
||||
.into());
|
||||
});
|
||||
}
|
||||
Ok(u16::from_be_bytes(
|
||||
raw_data[raw_data.len() - 2..raw_data.len()]
|
||||
@ -253,8 +252,7 @@ pub(crate) fn user_data_from_raw(
|
||||
_ if current_idx > total_len - 2 => Err(ByteConversionError::FromSliceTooSmall {
|
||||
found: total_len - 2,
|
||||
expected: current_idx,
|
||||
}
|
||||
.into()),
|
||||
}),
|
||||
_ => Ok(&slice[current_idx..total_len - 2]),
|
||||
}
|
||||
}
|
||||
|
@ -1183,10 +1183,10 @@ impl TryFrom<chrono::DateTime<chrono::Utc>> for CdsTime<DaysLen16Bits> {
|
||||
|
||||
fn try_from(dt: chrono::DateTime<chrono::Utc>) -> Result<Self, Self::Error> {
|
||||
let conversion = ConversionFromChronoDatetime::new(&dt)?;
|
||||
Ok(Self::generic_from_conversion(
|
||||
Self::generic_from_conversion(
|
||||
LengthOfDaySegment::Short16Bits,
|
||||
conversion,
|
||||
)?)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1195,10 +1195,10 @@ impl TryFrom<chrono::DateTime<chrono::Utc>> for CdsTime<DaysLen24Bits> {
|
||||
type Error = CdsError;
|
||||
fn try_from(dt: chrono::DateTime<chrono::Utc>) -> Result<Self, Self::Error> {
|
||||
let conversion = ConversionFromChronoDatetime::new(&dt)?;
|
||||
Ok(Self::generic_from_conversion(
|
||||
Self::generic_from_conversion(
|
||||
LengthOfDaySegment::Long24Bits,
|
||||
conversion,
|
||||
)?)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user