11error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
2- --> tests/ui/lines_filter_map_ok.rs:9 :31
2+ --> tests/ui/lines_filter_map_ok.rs:10 :31
33 |
44LL | BufReader::new(f).lines().filter_map(Result::ok).for_each(|_| ());
55 | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
66 |
77note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
8- --> tests/ui/lines_filter_map_ok.rs:9 :5
8+ --> tests/ui/lines_filter_map_ok.rs:10 :5
99 |
1010LL | BufReader::new(f).lines().filter_map(Result::ok).for_each(|_| ());
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -25,49 +25,49 @@ LL | BufReader::new(f).lines().flat_map(Result::ok).for_each(|_| ());
2525 | ^^^^^^^^^^^^^^^^^^^^^^^^^
2626
2727error: `flatten()` will run forever if the iterator repeatedly produces an `Err`
28- --> tests/ui/lines_filter_map_ok.rs:17 :31
28+ --> tests/ui/lines_filter_map_ok.rs:16 :31
2929 |
3030LL | BufReader::new(f).lines().flatten().for_each(|_| ());
3131 | ^^^^^^^^^ help: replace with: `map_while(Result::ok)`
3232 |
3333note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
34- --> tests/ui/lines_filter_map_ok.rs:17 :5
34+ --> tests/ui/lines_filter_map_ok.rs:16 :5
3535 |
3636LL | BufReader::new(f).lines().flatten().for_each(|_| ());
3737 | ^^^^^^^^^^^^^^^^^^^^^^^^^
3838
3939error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
40- --> tests/ui/lines_filter_map_ok.rs:22 :25
40+ --> tests/ui/lines_filter_map_ok.rs:19 :25
4141 |
4242LL | io::stdin().lines().filter_map(Result::ok).for_each(|_| ());
4343 | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
4444 |
4545note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
46- --> tests/ui/lines_filter_map_ok.rs:22 :5
46+ --> tests/ui/lines_filter_map_ok.rs:19 :5
4747 |
4848LL | io::stdin().lines().filter_map(Result::ok).for_each(|_| ());
4949 | ^^^^^^^^^^^^^^^^^^^
5050
5151error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
52- --> tests/ui/lines_filter_map_ok.rs:25 :25
52+ --> tests/ui/lines_filter_map_ok.rs:21 :25
5353 |
5454LL | io::stdin().lines().filter_map(|x| x.ok()).for_each(|_| ());
5555 | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
5656 |
5757note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
58- --> tests/ui/lines_filter_map_ok.rs:25 :5
58+ --> tests/ui/lines_filter_map_ok.rs:21 :5
5959 |
6060LL | io::stdin().lines().filter_map(|x| x.ok()).for_each(|_| ());
6161 | ^^^^^^^^^^^^^^^^^^^
6262
6363error: `flatten()` will run forever if the iterator repeatedly produces an `Err`
64- --> tests/ui/lines_filter_map_ok.rs:28 :25
64+ --> tests/ui/lines_filter_map_ok.rs:23 :25
6565 |
6666LL | io::stdin().lines().flatten().for_each(|_| ());
6767 | ^^^^^^^^^ help: replace with: `map_while(Result::ok)`
6868 |
6969note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
70- --> tests/ui/lines_filter_map_ok.rs:28 :5
70+ --> tests/ui/lines_filter_map_ok.rs:23 :5
7171 |
7272LL | io::stdin().lines().flatten().for_each(|_| ());
7373 | ^^^^^^^^^^^^^^^^^^^
0 commit comments