]> git.lizzy.rs Git - rust.git/blob - tests/ui/iter_skip_next.fixed
Fix `manual_map` at the end of an if chain
[rust.git] / tests / ui / iter_skip_next.fixed
1 // run-rustfix
2 // aux-build:option_helpers.rs
3
4 #![warn(clippy::iter_skip_next)]
5 #![allow(clippy::blacklisted_name)]
6 #![allow(clippy::iter_nth)]
7
8 extern crate option_helpers;
9
10 use option_helpers::IteratorFalsePositives;
11
12 /// Checks implementation of `ITER_SKIP_NEXT` lint
13 fn main() {
14     let some_vec = vec![0, 1, 2, 3];
15     let _ = some_vec.iter().nth(42);
16     let _ = some_vec.iter().cycle().nth(42);
17     let _ = (1..10).nth(10);
18     let _ = &some_vec[..].iter().nth(3);
19     let foo = IteratorFalsePositives { foo: 0 };
20     let _ = foo.skip(42).next();
21     let _ = foo.filter().skip(42).next();
22 }