Skip to content

Commit d15c358

Browse files
committed
Fix tests for checked_duration_since
1 parent 7b2a08c commit d15c358

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libstd/time.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ impl Instant {
224224
/// # Examples
225225
///
226226
/// ```no_run
227+
/// #![feature(checked_duration_since)]
227228
/// use std::time::{Duration, Instant};
228229
/// use std::thread::sleep;
229230
///
@@ -653,7 +654,8 @@ mod tests {
653654
#[test]
654655
fn checked_instant_duration_nopanic() {
655656
let a = Instant::now();
656-
(a - Duration::new(1, 0)).checked_duration_since(a);
657+
let ret = (a - Duration::new(1, 0)).checked_duration_since(a);
658+
assert_eq!(ret, None);
657659
}
658660

659661
#[test]

0 commit comments

Comments
 (0)