fix tests
This commit is contained in:
parent
415ddfb630
commit
ac6e7b2957
@ -3,13 +3,18 @@
|
||||
|
||||
#![deny(clippy, clippy_pedantic)]
|
||||
fn main() {
|
||||
let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an Iterator
|
||||
let _: Vec<_> = vec![5; 6].into_iter() //~ERROR called `filter(p).map(q)` on an `Iterator`
|
||||
.filter(|&x| x == 0)
|
||||
.map(|x| x * 2)
|
||||
.collect();
|
||||
|
||||
let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an Iterator
|
||||
let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter(p).flat_map(q)` on an `Iterator`
|
||||
.filter(|&x| x == 0)
|
||||
.flat_map(|x| x.checked_mul(2))
|
||||
.collect();
|
||||
|
||||
let _: Vec<_> = vec![5i8; 6].into_iter() //~ERROR called `filter_map(p).flat_map(q)` on an `Iterator`
|
||||
.filter_map(|x| x.checked_mul(2))
|
||||
.flat_map(|x| x.checked_mul(2))
|
||||
.collect();
|
||||
}
|
||||
|
@ -181,11 +181,11 @@ fn filter_next() {
|
||||
|
||||
// check single-line case
|
||||
let _ = v.iter().filter(|&x| *x < 0).next();
|
||||
//~^ ERROR called `filter(p).next()` on an Iterator.
|
||||
//~^ ERROR called `filter(p).next()` on an `Iterator`.
|
||||
//~| NOTE replace `filter(|&x| *x < 0).next()`
|
||||
|
||||
// check multi-line case
|
||||
let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an Iterator.
|
||||
let _ = v.iter().filter(|&x| { //~ERROR called `filter(p).next()` on an `Iterator`.
|
||||
*x < 0
|
||||
}
|
||||
).next();
|
||||
|
Loading…
Reference in New Issue
Block a user