We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de77a32 commit ea367d9Copy full SHA for ea367d9
library/core/src/time.rs
@@ -329,7 +329,7 @@ impl Duration {
329
pub const fn from_nanos_u128(nanos: u128) -> Duration {
330
const NANOS_PER_SEC: u128 = self::NANOS_PER_SEC as u128;
331
let secs: u128 = nanos / NANOS_PER_SEC;
332
- if (secs > u64::MAX.into()) {
+ if secs > u64::MAX as u128 {
333
panic!("overflow in duration in Duration::from_nanos_u128");
334
}
335
let subsec_nanos = (nanos % NANOS_PER_SEC) as u32;
0 commit comments