Skip to content

Commit 9a67924

Browse files
fixed the code quality failure
1 parent 12f900d commit 9a67924

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/uu/fold/src/fold.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,11 @@ fn fold_file<T: Read, W: Write>(
590590

591591
if let Some(pos) = buffer.iter().position(|&b| b == b'\n') {
592592
consume_len = pos + 1;
593-
} else {
594-
if let Err(e) = std::str::from_utf8(buffer) {
595-
if e.error_len().is_none() {
596-
let valid = e.valid_up_to();
597-
if valid > 0 {
598-
consume_len = valid;
599-
}
593+
} else if let Err(e) = std::str::from_utf8(buffer) {
594+
if e.error_len().is_none() {
595+
let valid = e.valid_up_to();
596+
if valid > 0 {
597+
consume_len = valid;
600598
}
601599
}
602600
}

0 commit comments

Comments
 (0)