Skip to content

Commit

Permalink
style: replace let _ = by _ =
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Sep 28, 2024
1 parent eda5e65 commit 4195c9d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions tests/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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::<u32>::new_empty(10).rotated_cw(1);
_ = Matrix::<u32>::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::<u32>::new_empty(10).rotated_ccw(1);
_ = Matrix::<u32>::new_empty(10).rotated_ccw(1);
}

#[test]
fn no_rows_rotated_twice() {
let _ = Matrix::<u32>::new_empty(10).rotated_cw(2);
let _ = Matrix::<u32>::new_empty(10).rotated_ccw(2);
_ = Matrix::<u32>::new_empty(10).rotated_cw(2);
_ = Matrix::<u32>::new_empty(10).rotated_ccw(2);
}

#[test]
Expand Down Expand Up @@ -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::<u32>::new_empty(10).transposed();
_ = Matrix::<u32>::new_empty(10).transposed();
}

#[test]
Expand Down Expand Up @@ -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::<Matrix<_>>();
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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], ,);
}
12 changes: 6 additions & 6 deletions tests/ui/matrix.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4195c9d

Please sign in to comment.