From bb6d4f1c0bdefd9dc78eb5496a9320fbb1c849a8 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Sun, 19 Apr 2026 16:12:57 +0900 Subject: [PATCH] od: remove collapsible_if --- src/uu/od/src/od.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/uu/od/src/od.rs b/src/uu/od/src/od.rs index 7762048ea3e..02a08ef4362 100644 --- a/src/uu/od/src/od.rs +++ b/src/uu/od/src/od.rs @@ -616,15 +616,13 @@ fn extract_strings_from_input( loop { // Check if we've reached the read_bytes limit - if let Some(limit) = read_bytes { - if bytes_read >= limit { - // Special case: when -N limit is reached with a pending string - // that meets min_length, output it even without null terminator - if current_string.len() >= min_length { - print_string(string_start_offset, ¤t_string)?; - } - break; + if read_bytes.is_some_and(|l| bytes_read >= l) { + // Special case: when -N limit is reached with a pending string + // that meets min_length, output it even without null terminator + if current_string.len() >= min_length { + print_string(string_start_offset, ¤t_string)?; } + break; } // Read one byte at a time