3 ms·
And if you write the equivalent to the `find_if` version in Rust, then the standard linter Clippy will automatically suggest the "good" version: warning: c
by mbrubeck 5y ago
And if you write the equivalent to the `find_if` version in Rust, then the standard linter Clippy will automatically suggest the "good" version:
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/lib.rs:2:9
|
2 | numbers.find(|i| i % 2 == 1).is_some()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|i| i % 2 == 1)`
|