about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/unchecked_duration_subtraction.fixed8
-rw-r--r--tests/ui/unchecked_duration_subtraction.stderr8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/ui/unchecked_duration_subtraction.fixed b/tests/ui/unchecked_duration_subtraction.fixed
index bcc231d93b1..a0e49a8beb1 100644
--- a/tests/ui/unchecked_duration_subtraction.fixed
+++ b/tests/ui/unchecked_duration_subtraction.fixed
@@ -7,11 +7,11 @@ fn main() {
     let _first = Instant::now();
     let second = Duration::from_secs(3);
 
-    let _ = _first.checked_sub(second).unwrap();;
+    let _ = _first.checked_sub(second).unwrap();
 
-    let _ = Instant::now().checked_sub(Duration::from_secs(5)).unwrap();;
+    let _ = Instant::now().checked_sub(Duration::from_secs(5)).unwrap();
 
-    let _ = _first.checked_sub(Duration::from_secs(5)).unwrap();;
+    let _ = _first.checked_sub(Duration::from_secs(5)).unwrap();
 
-    let _ = Instant::now().checked_sub(second).unwrap();;
+    let _ = Instant::now().checked_sub(second).unwrap();
 }
diff --git a/tests/ui/unchecked_duration_subtraction.stderr b/tests/ui/unchecked_duration_subtraction.stderr
index b949dbf701a..a2e0aa1d7c0 100644
--- a/tests/ui/unchecked_duration_subtraction.stderr
+++ b/tests/ui/unchecked_duration_subtraction.stderr
@@ -2,7 +2,7 @@ error: unchecked subtraction of a 'Duration' from an 'Instant'
   --> $DIR/unchecked_duration_subtraction.rs:10:13
    |
 LL |     let _ = _first - second;
-   |             ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap();`
+   |             ^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(second).unwrap()`
    |
    = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
 
@@ -10,19 +10,19 @@ error: unchecked subtraction of a 'Duration' from an 'Instant'
   --> $DIR/unchecked_duration_subtraction.rs:12:13
    |
 LL |     let _ = Instant::now() - Duration::from_secs(5);
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap();`
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap()`
 
 error: unchecked subtraction of a 'Duration' from an 'Instant'
   --> $DIR/unchecked_duration_subtraction.rs:14:13
    |
 LL |     let _ = _first - Duration::from_secs(5);
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap();`
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap()`
 
 error: unchecked subtraction of a 'Duration' from an 'Instant'
   --> $DIR/unchecked_duration_subtraction.rs:16:13
    |
 LL |     let _ = Instant::now() - second;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap();`
+   |             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(second).unwrap()`
 
 error: aborting due to 4 previous errors