2023-04-20 09:37:15 -05:00
|
|
|
//@run-rustfix
|
2022-10-01 09:02:57 -05: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;
|
|
|
|
}
|