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 c03d978 commit 7f8264bCopy full SHA for 7f8264b
library/core/src/time.rs
@@ -268,6 +268,11 @@ impl Duration {
268
269
/// Creates a new `Duration` from the specified number of nanoseconds.
270
///
271
+ /// Note: Using this on the return value of `as_nanos()` might cause unexpected
272
+ /// behavior: `as_nanos()` returns a u128, and can return values that do not
273
+ /// fit in u64, e.g. 585 years. Instead, consider using the pattern
274
+ /// `Duration::new(d.as_secs(), d.subsecs_nanos())`.
275
+ ///
276
/// # Examples
277
278
/// ```
0 commit comments