Skip to content

Commit

Permalink
Rollup merge of #76162 - abrausch:documentation-fix-duration_since, r…
Browse files Browse the repository at this point in the history
…=jyn514

Make duration_since documentation more clear
  • Loading branch information
Dylan-DPC authored Sep 8, 2020
2 parents 5099914 + 98231bf commit 87302a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/std/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,13 @@ impl SystemTime {
///
/// # Examples
///
/// ```
/// ```no_run
/// use std::time::SystemTime;
///
/// let sys_time = SystemTime::now();
/// let difference = sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// let new_sys_time = SystemTime::now();
/// let difference = new_sys_time.duration_since(sys_time)
/// .expect("Clock may have gone backwards");
/// println!("{:?}", difference);
/// ```
#[stable(feature = "time2", since = "1.8.0")]
Expand Down

0 comments on commit 87302a2

Please sign in to comment.