From b8641ba99865ca34ce1ba8932760d7e8a2e66a80 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Mon, 21 Oct 2024 19:17:07 +0300 Subject: [PATCH] clippy --- plugins/fs/src/commands.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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);