]>
Commit | Line | Data |
---|---|---|
923072b8 | 1 | // run-rustfix |
f20569fa | 2 | #![deny(clippy::while_let_on_iterator)] |
923072b8 | 3 | #![allow(unused_mut)] |
2b03887a | 4 | #![allow(clippy::uninlined_format_args)] |
f20569fa XL |
5 | |
6 | use std::iter::Iterator; | |
7 | ||
8 | struct Foo; | |
9 | ||
10 | impl Foo { | |
11 | fn foo1<I: Iterator<Item = usize>>(mut it: I) { | |
12 | while let Some(_) = it.next() { | |
13 | println!("{:?}", it.size_hint()); | |
14 | } | |
15 | } | |
16 | ||
17 | fn foo2<I: Iterator<Item = usize>>(mut it: I) { | |
18 | while let Some(e) = it.next() { | |
19 | println!("{:?}", e); | |
20 | } | |
21 | } | |
22 | } | |
23 | ||
24 | fn main() { | |
25 | Foo::foo1(vec![].into_iter()); | |
26 | Foo::foo2(vec![].into_iter()); | |
27 | } |