]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/iter_skip_next_unfixable.rs
Auto merge of #101969 - reez12g:issue-101306, r=reez12g
[rust.git] / src / tools / clippy / tests / ui / iter_skip_next_unfixable.rs
1 #![warn(clippy::iter_skip_next)]
2 #![allow(dead_code)]
3
4 /// Checks implementation of `ITER_SKIP_NEXT` lint
5 fn main() {
6     // fix #8128
7     let test_string = "1|1 2";
8     let sp = test_string.split('|').map(|s| s.trim());
9     let _: Vec<&str> = sp.skip(1).next().unwrap().split(' ').collect();
10     if let Some(s) = Some(test_string.split('|').map(|s| s.trim())) {
11         let _: Vec<&str> = s.skip(1).next().unwrap().split(' ').collect();
12     };
13     fn check<T>(s: T)
14     where
15         T: Iterator<Item = String>,
16     {
17         let _: Vec<&str> = s.skip(1).next().unwrap().split(' ').collect();
18     }
19 }