Update Duration::as_secs doc example to demonstrate truncation.

This commit is contained in:
Corey Farwell 2017-05-02 23:58:39 -04:00
parent ee8ad8eb2e
commit bdd8e7ffe6

View File

@ -125,8 +125,8 @@ impl Duration {
/// ```
/// use std::time::Duration;
///
/// let five_seconds = Duration::new(5, 0);
/// assert_eq!(five_seconds.as_secs(), 5);
/// let duration = Duration::new(5, 730023852);
/// assert_eq!(duration.as_secs(), 5);
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]