mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 00:56:14 +00:00
11 lines
242 B
Rust
11 lines
242 B
Rust
#![warn(clippy::filter_next)]
|
|
#![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();
|
|
}
|