rust/tests/ui/methods_fixable.rs

13 lines
258 B
Rust
Raw Normal View History

//@run-rustfix
#![warn(clippy::filter_next)]
2023-06-06 15:56:57 -05:00
#![allow(clippy::useless_vec)]
/// Checks implementation of `FILTER_NEXT` lint.
fn main() {
let v = vec![3, 2, 1, 0, -1, -2, -3];
// Single-line case.
let _ = v.iter().filter(|&x| *x < 0).next();
}