You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Help suggestion is wrong.
It say to use any instead of any, but the code does not contains any.
Reproducer
I tried this code:
let _ = [1,2,3].iter().find(|x| **x == 3).is_some();
I expected to see this happen:
I did not really think about using any, so I did not expect an warning.
Instead, this happened:
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/main.rs:4:30
|
4 | let _ = [1, 2, 3].iter().find(|x| **x == 3).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 3)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
= note: `#[warn(clippy::search_is_some)]` on by default
I do not know, if the sentence is technically correct in UK English, or US English, or AU English, or any other subset of English, but to me it is really confusing. Something like help: consider using: `any(|x| *x == 3)` instead would make much more sense.
Even just help: use `any()` would be less confusing that the current wording.
Summary
Help suggestion is wrong.
It say to use
any
instead ofany
, but the code does not containsany
.Reproducer
I tried this code:
I expected to see this happen:
I did not really think about using
any
, so I did not expect an warning.Instead, this happened:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: