diff --git a/plugins/fs/src/commands.rs b/plugins/fs/src/commands.rs index e4fffee3..8d275dcc 100644 --- a/plugins/fs/src/commands.rs +++ b/plugins/fs/src/commands.rs @@ -1176,11 +1176,13 @@ mod test { let bytes = base.as_bytes(); let string1 = base.lines().collect::(); - let string2 = BufReader::new(bytes).lines().flatten().collect::(); + let string2 = BufReader::new(bytes) + .lines() + .map_while(Result::ok) + .collect::(); let string3 = LinesBytes(BufReader::new(bytes)) .flatten() - .map(|s| String::from_utf8(s)) - .flatten() + .flat_map(String::from_utf8) .collect::(); assert_eq!(string1, string2);