Rust

Rust

Made by DeepSource

Found occurrence of .filter(..).next() RS-W1023

Anti-pattern
Minor

.filter(..).next() is equivalent to .find(..). Prefer .find(..) for readability.

Bad practice

vec.iter().filter(|x| x != 2).next();

Recommended

vec.iter().find(|x| x != 2);

References