2022-11-08 03:22:58 -06: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;
|
|
|
|
}
|