Rollup merge of #76162 - abrausch:documentation-fix-duration_since, r=jyn514

Make duration_since documentation more clear
This commit is contained in:
Dylan DPC 2020-09-09 01:35:10 +02:00 committed by GitHub
commit 87302a297c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")]