Skip to content

Commit 1c49059

Browse files
oech3cakebaker
authored andcommitted
cat: remove collapsible_if
1 parent f08652f commit 1c49059

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/uu/cat/src/platform/unix.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ pub fn is_unsafe_overwrite<I: AsFd, O: AsFd>(input: &I, output: &O) -> bool {
3535
let input_pos = rustix::fs::seek(input, SeekFrom::Current(0)).map(|v| v as i64);
3636
let output_pos = rustix::fs::seek(output, SeekFrom::Current(0)).map(|v| v as i64);
3737
if is_appending(output) {
38-
if let Ok(pos) = input_pos {
39-
if pos >= 0 && (pos as u64) >= file_size {
40-
return false;
41-
}
42-
}
43-
return true;
38+
return !input_pos.is_ok_and(|pos| pos >= 0 && (pos as u64) >= file_size);
4439
}
4540
let Ok(input_pos) = input_pos else {
4641
return false;

0 commit comments

Comments
 (0)