Skip to content

Commit de77a32

Browse files
fix: remove non-const .into() call from const function
A const function cannot call non-const functions, so we remove the trailing .into() call and use raw literals instead.
1 parent ab394b9 commit de77a32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl Duration {
328328
#[inline]
329329
pub const fn from_nanos_u128(nanos: u128) -> Duration {
330330
const NANOS_PER_SEC: u128 = self::NANOS_PER_SEC as u128;
331-
let secs: u128 = (nanos / NANOS_PER_SEC);
331+
let secs: u128 = nanos / NANOS_PER_SEC;
332332
if (secs > u64::MAX.into()) {
333333
panic!("overflow in duration in Duration::from_nanos_u128");
334334
}

0 commit comments

Comments
 (0)