From e1199acbb104b9c4f3b870e94fa5c30bb69e4e6e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Sat, 18 Apr 2026 09:58:51 +0900 Subject: [PATCH] split: remove collapsible_if --- src/uu/split/src/split.rs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/uu/split/src/split.rs b/src/uu/split/src/split.rs index 1540950c172..596e6ffb986 100644 --- a/src/uu/split/src/split.rs +++ b/src/uu/split/src/split.rs @@ -1028,16 +1028,16 @@ impl ManageOutFiles for OutFiles { // Could have hit system limit for open files. // Try to close one previously instantiated writer first for (i, out_file) in self.iter_mut().enumerate() { - if i != idx { - if let Some(writer) = out_file.maybe_writer.as_mut() { - writer.flush()?; - out_file.maybe_writer = None; - out_file.is_new = false; - count += 1; - - // And then try to instantiate the writer again - continue 'loop1; - } + if i != idx + && let Some(writer) = out_file.maybe_writer.as_mut() + { + writer.flush()?; + out_file.maybe_writer = None; + out_file.is_new = false; + count += 1; + + // And then try to instantiate the writer again + continue 'loop1; } } @@ -1331,11 +1331,8 @@ where if settings.elide_empty_files && skipped > 0 && kth_chunk.is_none() { chunk_number -= skipped as u64; } - - if let Some(kth) = kth_chunk { - if chunk_number > kth { - break; - } + if kth_chunk.is_some_and(|k| chunk_number > k) { + break; } } Ok(())