Fix tests for checked_duration_since
This commit is contained in:
parent
7b2a08cf49
commit
d15c358000
@ -224,6 +224,7 @@ pub fn duration_since(&self, earlier: Instant) -> Duration {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// #![feature(checked_duration_since)]
|
||||
/// use std::time::{Duration, Instant};
|
||||
/// use std::thread::sleep;
|
||||
///
|
||||
@ -653,7 +654,8 @@ fn instant_duration_panic() {
|
||||
#[test]
|
||||
fn checked_instant_duration_nopanic() {
|
||||
let a = Instant::now();
|
||||
(a - Duration::new(1, 0)).checked_duration_since(a);
|
||||
let ret = (a - Duration::new(1, 0)).checked_duration_since(a);
|
||||
assert_eq!(ret, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user