Skip to content

Commit d2bd2d3

Browse files
authored
Merge pull request #10435 from aaron-ang/clippy-hotfix
fix(CI): clippy unnecessary unwrap
2 parents 2de0a5b + df04d02 commit d2bd2d3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/uu/split/src/split.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,14 +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 && out_file.maybe_writer.is_some() {
1032-
out_file.maybe_writer.as_mut().unwrap().flush()?;
1033-
out_file.maybe_writer = None;
1034-
out_file.is_new = false;
1035-
count += 1;
1036-
1037-
// And then try to instantiate the writer again
1038-
continue 'loop1;
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+
}
10391041
}
10401042
}
10411043

0 commit comments

Comments
 (0)