small tweak
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2023-01-15 18:26:18 +01:00
parent 51e134f031
commit 73dbc80cad
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -955,8 +955,8 @@ fn add_for_max_ccsds_days_val<T: ProvidesDaysLength>(
Some(SubmillisPrecision::Microseconds(us)) Some(SubmillisPrecision::Microseconds(us))
} }
SubmillisPrecision::Picoseconds(mut ps) => { SubmillisPrecision::Picoseconds(mut ps) => {
let nanos = duration.subsec_nanos(); // 1 ms as ns is 1e6.
let submilli_nanos = nanos % 10_u32.pow(6); let submilli_nanos = duration.subsec_nanos() % 10_u32.pow(6);
// No overflow risk: The maximum value of an u32 is ~4.294e9, and one ms as ps // No overflow risk: The maximum value of an u32 is ~4.294e9, and one ms as ps
// is 1e9. The amount ps can now have is always less than 2e9. // is 1e9. The amount ps can now have is always less than 2e9.
ps += submilli_nanos * 1000; ps += submilli_nanos * 1000;