Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: replace let _ = by _ = #605

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading