mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Update Duration::from_secs doc example to show underlying values.
This commit is contained in:
@@ -84,7 +84,10 @@ pub fn new(secs: u64, nanos: u32) -> Duration {
|
||||
/// ```
|
||||
/// use std::time::Duration;
|
||||
///
|
||||
/// let five_seconds = Duration::from_secs(5);
|
||||
/// let duration = Duration::from_secs(5);
|
||||
///
|
||||
/// assert_eq!(5, duration.as_secs());
|
||||
/// assert_eq!(0, duration.subsec_nanos());
|
||||
/// ```
|
||||
#[stable(feature = "duration", since = "1.3.0")]
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user