Location: crates/diffguard/src/main.rs:1925
Problem:
let duration_ms = start_time.elapsed().as_millis() as u64;
Duration::as_millis() returns u128. The as u64 cast silently truncates on targets where the elapsed duration exceeds u64::MAX milliseconds. This is distinct from the i64→u64 sign cast at line 2609 (covered by issue #582).
Fix: Use try_into() with a checked/saturated conversion:
let duration_ms = u64::try_from(start_time.elapsed().as_millis())
.unwrap_or(u64::MAX);
Location:
crates/diffguard/src/main.rs:1925Problem:
Duration::as_millis()returnsu128. Theas u64cast silently truncates on targets where the elapsed duration exceedsu64::MAXmilliseconds. This is distinct from thei64→u64sign cast at line 2609 (covered by issue #582).Fix: Use
try_into()with a checked/saturated conversion: