Skip to content

Commit ffd3838

Browse files
committed
fold: fix clippy warnings
1 parent 82b97d0 commit ffd3838

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/uu/fold/src/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn fold_file_bytewise<T: Read>(mut file: BufReader<T>, spaces: bool, width: usiz
155155
break;
156156
}
157157

158-
if line.len() == 1 && *line.get(0).unwrap() == NL {
158+
if line == [NL] {
159159
println!();
160160
line.truncate(0);
161161
continue;
@@ -186,7 +186,7 @@ fn fold_file_bytewise<T: Read>(mut file: BufReader<T>, spaces: bool, width: usiz
186186
// Don't duplicate trailing newlines: if the slice is "\n", the
187187
// previous iteration folded just before the end of the line and
188188
// has already printed this newline.
189-
if slice == &[NL] {
189+
if slice == [NL] {
190190
break;
191191
}
192192

0 commit comments

Comments
 (0)