From 4195c9d91538c16f855632c20718dc567680dd00 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 26 Sep 2024 18:39:18 +0200 Subject: [PATCH] style: replace `let _ =` by `_ =` --- tests/matrix.rs | 14 +++++++------- tests/ui/matrix.rs | 6 +++--- tests/ui/matrix.stderr | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/matrix.rs b/tests/matrix.rs index 59a8d5bb..6ba06e83 100644 --- a/tests/matrix.rs +++ b/tests/matrix.rs @@ -71,7 +71,7 @@ fn from_vec_empty_row_error() { #[test] #[should_panic(expected = "unable to create a matrix with empty rows")] fn new_empty_row_panic() { - let _ = Matrix::new(1, 0, 42); + _ = Matrix::new(1, 0, 42); } #[test] @@ -221,19 +221,19 @@ fn non_square_rotate() { #[test] #[should_panic(expected = "this operation would create a matrix with empty rows")] fn no_rows_rotated_cw_panic() { - let _ = Matrix::::new_empty(10).rotated_cw(1); + _ = Matrix::::new_empty(10).rotated_cw(1); } #[test] #[should_panic(expected = "this operation would create a matrix with empty rows")] fn no_rows_rotated_ccw_panic() { - let _ = Matrix::::new_empty(10).rotated_ccw(1); + _ = Matrix::::new_empty(10).rotated_ccw(1); } #[test] fn no_rows_rotated_twice() { - let _ = Matrix::::new_empty(10).rotated_cw(2); - let _ = Matrix::::new_empty(10).rotated_ccw(2); + _ = Matrix::::new_empty(10).rotated_cw(2); + _ = Matrix::::new_empty(10).rotated_ccw(2); } #[test] @@ -291,7 +291,7 @@ fn transpose() { #[test] #[should_panic(expected = "this operation would create a matrix with empty rows")] fn no_rows_transposed_panic() { - let _ = Matrix::::new_empty(10).transposed(); + _ = Matrix::::new_empty(10).transposed(); } #[test] @@ -635,7 +635,7 @@ fn from_iter() { #[test] #[should_panic(expected = "provided data does not correspond to the expected length")] fn from_iter_error() { - let _ = (1..3) + _ = (1..3) .map(|n| (1..n).map(move |x| x * n)) .collect::>(); } diff --git a/tests/ui/matrix.rs b/tests/ui/matrix.rs index 710cc911..7df61ac4 100644 --- a/tests/ui/matrix.rs +++ b/tests/ui/matrix.rs @@ -2,8 +2,8 @@ use pathfinding::matrix; fn main() { // Empty matrix must be rejected - let _ = matrix!(); + _ = matrix!(); // Single comma and multiple commas at the end must be rejected - let _ = matrix!(,); - let _ = matrix!( [1, 2], [3, 4], ,); + _ = matrix!(,); + _ = matrix!( [1, 2], [3, 4], ,); } diff --git a/tests/ui/matrix.stderr b/tests/ui/matrix.stderr index 2034f15d..bc39976f 100644 --- a/tests/ui/matrix.stderr +++ b/tests/ui/matrix.stderr @@ -1,16 +1,16 @@ error: no rules expected the token `,` - --> tests/ui/matrix.rs:7:21 + --> tests/ui/matrix.rs:7:17 | -7 | let _ = matrix!(,); - | ^ no rules expected this token in macro call +7 | _ = matrix!(,); + | ^ no rules expected this token in macro call | = note: while trying to match end of macro error: no rules expected the token `,` - --> tests/ui/matrix.rs:8:38 + --> tests/ui/matrix.rs:8:34 | -8 | let _ = matrix!( [1, 2], [3, 4], ,); - | ^ no rules expected this token in macro call +8 | _ = matrix!( [1, 2], [3, 4], ,); + | ^ no rules expected this token in macro call | note: while trying to match meta-variable `$b:expr` --> src/matrix.rs