@@ -2,27 +2,27 @@ error: unchecked subtraction of a 'Duration' from an 'Instant'
2
2
--> $DIR/unchecked_duration_subtraction.rs:10:13
3
3
|
4
4
LL | let _ = _first - second;
5
- | ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap(); `
5
+ | ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
6
6
|
7
7
= note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
8
8
9
9
error: unchecked subtraction of a 'Duration' from an 'Instant'
10
10
--> $DIR/unchecked_duration_subtraction.rs:12:13
11
11
|
12
12
LL | let _ = Instant::now() - Duration::from_secs(5);
13
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap(); `
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`
14
14
15
15
error: unchecked subtraction of a 'Duration' from an 'Instant'
16
16
--> $DIR/unchecked_duration_subtraction.rs:14:13
17
17
|
18
18
LL | let _ = _first - Duration::from_secs(5);
19
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap(); `
19
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`
20
20
21
21
error: unchecked subtraction of a 'Duration' from an 'Instant'
22
22
--> $DIR/unchecked_duration_subtraction.rs:16:13
23
23
|
24
24
LL | let _ = Instant::now() - second;
25
- | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap(); `
25
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
26
26
27
27
error: aborting due to 4 previous errors
28
28
0 commit comments