2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-11-21 13:34:47 -06:00
|
|
|
#![warn(clippy::unchecked_duration_subtraction)]
|
|
|
|
|
|
|
|
use std::time::{Duration, Instant};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _first = Instant::now();
|
|
|
|
let second = Duration::from_secs(3);
|
|
|
|
|
|
|
|
let _ = _first - second;
|
|
|
|
|
|
|
|
let _ = Instant::now() - Duration::from_secs(5);
|
|
|
|
|
|
|
|
let _ = _first - Duration::from_secs(5);
|
|
|
|
|
|
|
|
let _ = Instant::now() - second;
|
|
|
|
}
|