From d3af6fd529c162a47a6b6ef8a0d7ce7f7f8452e9 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sat, 13 Sep 2025 16:07:09 +0200 Subject: [PATCH] du: remove condition with identical if/else blocks --- src/uu/du/src/du.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index af3b4d29d..82b73c7e1 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -719,18 +719,9 @@ fn du_regular( } } Err(e) => { - // Check if this is the "too many symlinks" error we want to catch - if e.kind() == std::io::ErrorKind::InvalidData - && e.to_string().contains("Too many levels") - { - print_tx.send(Err(e.map_err_context( + print_tx.send(Err(e.map_err_context( || translate!("du-error-cannot-access", "path" => entry_path.quote()), )))?; - } else { - print_tx.send(Err(e.map_err_context( - || translate!("du-error-cannot-access", "path" => entry_path.quote()), - )))?; - } } } }