Skip to content

Commit 9a9c228

Browse files
oech3cakebaker
authored andcommitted
split: remove collapsible_if
1 parent 26223ad commit 9a9c228

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

src/uu/split/src/split.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,16 +1028,16 @@ impl ManageOutFiles for OutFiles {
10281028
// Could have hit system limit for open files.
10291029
// Try to close one previously instantiated writer first
10301030
for (i, out_file) in self.iter_mut().enumerate() {
1031-
if i != idx {
1032-
if let Some(writer) = out_file.maybe_writer.as_mut() {
1033-
writer.flush()?;
1034-
out_file.maybe_writer = None;
1035-
out_file.is_new = false;
1036-
count += 1;
1037-
1038-
// And then try to instantiate the writer again
1039-
continue 'loop1;
1040-
}
1031+
if i != idx
1032+
&& let Some(writer) = out_file.maybe_writer.as_mut()
1033+
{
1034+
writer.flush()?;
1035+
out_file.maybe_writer = None;
1036+
out_file.is_new = false;
1037+
count += 1;
1038+
1039+
// And then try to instantiate the writer again
1040+
continue 'loop1;
10411041
}
10421042
}
10431043

@@ -1331,11 +1331,8 @@ where
13311331
if settings.elide_empty_files && skipped > 0 && kth_chunk.is_none() {
13321332
chunk_number -= skipped as u64;
13331333
}
1334-
1335-
if let Some(kth) = kth_chunk {
1336-
if chunk_number > kth {
1337-
break;
1338-
}
1334+
if kth_chunk.is_some_and(|k| chunk_number > k) {
1335+
break;
13391336
}
13401337
}
13411338
Ok(())

0 commit comments

Comments
 (0)