We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2e35d8 commit 0df7f93Copy full SHA for 0df7f93
library/core/src/time.rs
@@ -321,10 +321,12 @@ impl Duration {
321
/// ```
322
/// #![feature(duration_from_nanos_u128)]
323
/// use std::time::Duration;
324
- /// let time_in_nanos = 2.pow(64);
+ /// let time_in_nanos = 2u128.pow(64);
325
/// let duration = Duration::from_nanos_u128(time_in_nanos);
326
327
#[unstable(feature = "duration_from_nanos_u128", issue = "139201")]
328
+ #[must_use]
329
+ #[inline]
330
pub const fn from_nanos_u128(nanos: u128) -> Duration {
331
const NANOS_PER_SEC: u128 = self::NANOS_PER_SEC as u128;
332
let secs : u64 = (nanos/ NANOS_PER_SEC) as u64 ;
0 commit comments