]> git.lizzy.rs Git - rust.git/blob - tests/ui/filter_methods.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / filter_methods.rs
1 #![feature(tool_lints)]
2
3
4 #![warn(clippy::all, clippy::pedantic)]
5 #![allow(clippy::missing_docs_in_private_items)]
6
7 fn main() {
8     let _: Vec<_> = vec![5; 6].into_iter()
9                               .filter(|&x| x == 0)
10                               .map(|x| x * 2)
11                               .collect();
12
13     let _: Vec<_> = vec![5_i8; 6].into_iter()
14                                 .filter(|&x| x == 0)
15                                 .flat_map(|x| x.checked_mul(2))
16                                 .collect();
17
18     let _: Vec<_> = vec![5_i8; 6].into_iter()
19                                 .filter_map(|x| x.checked_mul(2))
20                                 .flat_map(|x| x.checked_mul(2))
21                                 .collect();
22
23     let _: Vec<_> = vec![5_i8; 6].into_iter()
24                                 .filter_map(|x| x.checked_mul(2))
25                                 .map(|x| x.checked_mul(2))
26                                 .collect();
27 }