chore: clippy rules, allow unwrap for consts

* Formatting
This commit is contained in:
Jakub Kołodziej committed 2026-06-06 12:48:15 +02:00
1 parent 7b12b25053
commit f9e4214a28
3 files changed
+6 -6

No files matched your search

+1
View File
@@ -1 +1,2 @@
allow-unwrap-in-tests = true
allow-unwrap-in-consts = true
+1 -2
View File
@@ -192,8 +192,7 @@ impl<'stamp> PusTmSecondaryHeader<'stamp> {
.into());
}
let pus_version = PusVersion::try_from(u4::new((buf[0] >> 4) & 0x0F));
let pus_version =
pus_version.map_err(PusError::VersionNotSupported)?;
let pus_version = pus_version.map_err(PusError::VersionNotSupported)?;
if !matches!(pus_version, PusVersion::PusA) {
return Err(PusError::VersionNotSupported(pus_version.raw_value()));
}
+4 -4
View File
@@ -866,8 +866,8 @@ impl Add<Duration> for CucTime {
fn add(self, duration: Duration) -> Self::Output {
let (new_counter, new_fractional_part) =
get_time_values_after_duration_addition(&self, duration);
// The generated fractional part should always be valid, so its okay to unwrap here.
Self::new_with_fractions(new_counter, new_fractional_part).unwrap()
Self::new_with_fractions(new_counter, new_fractional_part)
.expect("The generated fractional part should always be valid")
}
}
@@ -877,8 +877,8 @@ impl Add<Duration> for &CucTime {
fn add(self, duration: Duration) -> Self::Output {
let (new_counter, new_fractional_part) =
get_time_values_after_duration_addition(self, duration);
// The generated fractional part should always be valid, so its okay to unwrap here.
Self::Output::new_with_fractions(new_counter, new_fractional_part).unwrap()
Self::Output::new_with_fractions(new_counter, new_fractional_part)
.expect("The generated fractional part should always be valid")
}
}