diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/methods_fixable.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/methods_fixable.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/methods_fixable.rs b/src/tools/clippy/tests/ui/methods_fixable.rs new file mode 100644 index 000000000..6d0f1b7bd --- /dev/null +++ b/src/tools/clippy/tests/ui/methods_fixable.rs @@ -0,0 +1,11 @@ +// run-rustfix + +#![warn(clippy::filter_next)] + +/// 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(); +} |