Skip to content

Commit

Permalink
style: fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxqiu committed Apr 1, 2024
1 parent 9d1f824 commit 5658040
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 2 additions & 4 deletions tests/ui/search_is_some_fixable_none.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,8 @@ mod issue_11910 {
}

struct Foo;
impl Foo{
fn bar(&self, _ : bool) {

}
impl Foo {
fn bar(&self, _: bool) {}
}

fn test_then() {
Expand Down
6 changes: 2 additions & 4 deletions tests/ui/search_is_some_fixable_none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,8 @@ mod issue_11910 {
}

struct Foo;
impl Foo{
fn bar(&self, _ : bool) {

}
impl Foo {
fn bar(&self, _: bool) {}
}

fn test_then() {
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/search_is_some_fixable_none.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,19 @@ LL | let _ = v.iter().find(|fp| test_u32_2(*fp.field)).is_none();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!v.iter().any(|fp| test_u32_2(*fp.field))`

error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:237:9
--> $DIR/search_is_some_fixable_none.rs:235:9
|
LL | v.iter().find(|x| **x == 42).is_none().then(computations);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead: `(!v.iter().any(|x| *x == 42))`

error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:242:9
--> $DIR/search_is_some_fixable_none.rs:240:9
|
LL | v.iter().find(|x| **x == 42).is_none().then_some(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead: `(!v.iter().any(|x| *x == 42))`

error: called `is_none()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_none.rs:244:17
--> $DIR/search_is_some_fixable_none.rs:242:17
|
LL | Foo.bar(v.iter().find(|x| **x == 42).is_none());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead: `!v.iter().any(|x| *x == 42)`
Expand Down

0 comments on commit 5658040

Please sign in to comment.