removed unnecessary casts
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
This commit is contained in:
parent
46e2af41d2
commit
f964342556
@ -308,13 +308,13 @@ impl<TYPE: ToBeBytes> EcssEnumeration for GenericEcssEnumWrapper<TYPE> {
|
||||
}
|
||||
|
||||
fn write_to_be_bytes(&self, buf: &mut [u8]) -> Result<(), ByteConversionError> {
|
||||
if buf.len() < self.byte_width() as usize {
|
||||
if buf.len() < self.byte_width() {
|
||||
return Err(ByteConversionError::ToSliceTooSmall(SizeMissmatch {
|
||||
found: buf.len(),
|
||||
expected: self.byte_width() as usize,
|
||||
expected: self.byte_width(),
|
||||
}));
|
||||
}
|
||||
buf[0..self.byte_width() as usize].copy_from_slice(self.val.to_be_bytes().as_ref());
|
||||
buf[0..self.byte_width()].copy_from_slice(self.val.to_be_bytes().as_ref());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ impl CdsShortTimeProvider {
|
||||
};
|
||||
let unix_days_seconds =
|
||||
ccsds_to_unix_days(ccsds_days as i32) as i64 * SECONDS_PER_DAY as i64;
|
||||
provider.setup(unix_days_seconds as i64, ms_of_day.into())
|
||||
provider.setup(unix_days_seconds, ms_of_day.into())
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
@ -223,7 +223,7 @@ impl CcsdsTimeProvider for CdsShortTimeProvider {
|
||||
}
|
||||
|
||||
fn date_time(&self) -> Option<DateTime<Utc>> {
|
||||
self.calc_date_time((self.ms_of_day % 1000) as u32)
|
||||
self.calc_date_time(self.ms_of_day % 1000)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user