Skip to content

Commit

Permalink
Change variable named foo and rerun update-all-references
Browse files Browse the repository at this point in the history
  • Loading branch information
rsulli55 committed Nov 11, 2020
1 parent 56d252c commit 5c1c50e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
8 changes: 4 additions & 4 deletions tests/ui/search_is_some.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ fn main() {
).is_some();

// Check that we don't lint if the caller is not an `Iterator` or string
let foo = IteratorFalsePositives { foo: 0 };
let _ = foo.find().is_some();
let _ = foo.position().is_some();
let _ = foo.rposition().is_some();
let falsepos = IteratorFalsePositives { foo: 0 };
let _ = falsepos.find().is_some();
let _ = falsepos.position().is_some();
let _ = falsepos.rposition().is_some();
// check that we don't lint if `find()` is called with
// `Pattern` that is not a string
let _ = "hello world".find(|c: char| c == 'o' || c == 'l').is_some();
Expand Down
16 changes: 4 additions & 12 deletions tests/ui/search_is_some.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: called `is_some()` after searching an `Iterator` with find
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some.rs:13:13
|
LL | let _ = v.iter().find(|&x| {
Expand All @@ -11,7 +11,7 @@ LL | | ).is_some();
= note: `-D clippy::search-is-some` implied by `-D warnings`
= help: this is more succinctly expressed by calling `any()`

error: called `is_some()` after searching an `Iterator` with position
error: called `is_some()` after searching an `Iterator` with `position`
--> $DIR/search_is_some.rs:19:13
|
LL | let _ = v.iter().position(|&x| {
Expand All @@ -23,7 +23,7 @@ LL | | ).is_some();
|
= help: this is more succinctly expressed by calling `any()`

error: called `is_some()` after searching an `Iterator` with rposition
error: called `is_some()` after searching an `Iterator` with `rposition`
--> $DIR/search_is_some.rs:25:13
|
LL | let _ = v.iter().rposition(|&x| {
Expand All @@ -35,13 +35,5 @@ LL | | ).is_some();
|
= help: this is more succinctly expressed by calling `any()`

error: use of a blacklisted/placeholder name `foo`
--> $DIR/search_is_some.rs:31:9
|
LL | let foo = IteratorFalsePositives { foo: 0 };
| ^^^
|
= note: `-D clippy::blacklisted-name` implied by `-D warnings`

error: aborting due to 4 previous errors
error: aborting due to 3 previous errors

12 changes: 6 additions & 6 deletions tests/ui/search_is_some_fixable.stderr
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
error: called `is_some()` after searching an `Iterator` with find
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable.rs:10:22
|
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x < 0)`
|
= note: `-D clippy::search-is-some` implied by `-D warnings`

error: called `is_some()` after searching an `Iterator` with find
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable.rs:11:20
|
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| **y == x)`

error: called `is_some()` after searching an `Iterator` with find
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable.rs:12:20
|
LL | let _ = (0..1).find(|x| *x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0)`

error: called `is_some()` after searching an `Iterator` with find
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable.rs:13:22
|
LL | let _ = v.iter().find(|x| **x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 0)`

error: called `is_some()` after searching an `Iterator` with position
error: called `is_some()` after searching an `Iterator` with `position`
--> $DIR/search_is_some_fixable.rs:16:22
|
LL | let _ = v.iter().position(|&x| x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)`

error: called `is_some()` after searching an `Iterator` with rposition
error: called `is_some()` after searching an `Iterator` with `rposition`
--> $DIR/search_is_some_fixable.rs:19:22
|
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
Expand Down

0 comments on commit 5c1c50e

Please sign in to comment.