We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8bede1b + 04fb7f3 commit 69c0e9bCopy full SHA for 69c0e9b
src/std_misc/file/read_lines.md
@@ -56,7 +56,7 @@ fn main() {
56
// File hosts.txt must exist in the current path
57
if let Ok(lines) = read_lines("./hosts.txt") {
58
// Consumes the iterator, returns an (Optional) String
59
- for line in lines.flatten() {
+ for line in lines.map_while(Result::ok) {
60
println!("{}", line);
61
}
62
0 commit comments