1 error: this loop could be written as a `while let` loop
2 --> $DIR/while_loop.rs:6:5
5 LL | | if let Some(_x) = y {
11 | |_____^ help: try: `while let Some(_x) = y { .. }`
13 = note: `-D clippy::while-let-loop` implied by `-D warnings`
15 error: this loop could be written as a `while let` loop
16 --> $DIR/while_loop.rs:20:5
20 LL | | Some(_x) => true,
24 | |_____^ help: try: `while let Some(_x) = y { .. }`
26 error: this loop could be written as a `while let` loop
27 --> $DIR/while_loop.rs:26:5
30 LL | | let x = match y {
34 LL | | let _str = "foo";
36 | |_____^ help: try: `while let Some(x) = y { .. }`
38 error: this loop could be written as a `while let` loop
39 --> $DIR/while_loop.rs:34:5
42 LL | | let x = match y {
48 | |_____^ help: try: `while let Some(x) = y { .. }`
50 error: this loop could be written as a `while let` loop
51 --> $DIR/while_loop.rs:62:5
54 LL | | let (e, l) = match "".split_whitespace().next() {
55 LL | | Some(word) => (word.is_empty(), word.len()),
58 LL | | let _ = (e, l);
60 | |_____^ help: try: `while let Some(word) = "".split_whitespace().next() { .. }`
62 error: this loop could be written as a `for` loop
63 --> $DIR/while_loop.rs:72:33
65 LL | while let Option::Some(x) = iter.next() {
66 | ^^^^^^^^^^^ help: try: `for x in iter { .. }`
68 = note: `-D clippy::while-let-on-iterator` implied by `-D warnings`
70 error: this loop could be written as a `for` loop
71 --> $DIR/while_loop.rs:77:25
73 LL | while let Some(x) = iter.next() {
74 | ^^^^^^^^^^^ help: try: `for x in iter { .. }`
76 error: this loop could be written as a `for` loop
77 --> $DIR/while_loop.rs:82:25
79 LL | while let Some(_) = iter.next() {}
80 | ^^^^^^^^^^^ help: try: `for _ in iter { .. }`
82 error: this loop could be written as a `while let` loop
83 --> $DIR/while_loop.rs:125:5
86 LL | | let _ = match iter.next() {
87 LL | | Some(ele) => ele,
92 | |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
94 error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
95 --> $DIR/while_loop.rs:130:9
100 = note: `-D clippy::empty-loop` implied by `-D warnings`
102 error: this loop could be written as a `for` loop
103 --> $DIR/while_loop.rs:188:29
105 LL | while let Some(v) = y.next() {
106 | ^^^^^^^^ help: try: `for v in y { .. }`
108 error: this loop could be written as a `for` loop
109 --> $DIR/while_loop.rs:216:26
111 LL | while let Some(..) = values.iter().next() {
112 | ^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in values.iter() { .. }`
114 error: aborting due to 12 previous errors