From 282224e353818f4216b7106f1f96398700a40139 Mon Sep 17 00:00:00 2001 From: Kodi Craft Date: Thu, 19 May 2022 19:32:57 +0200 Subject: [PATCH] Removed redundant error message when using hyperlinks if file is a broken symlink --- src/meta/name.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/meta/name.rs b/src/meta/name.rs index 0b7b4a5..139ff88 100644 --- a/src/meta/name.rs +++ b/src/meta/name.rs @@ -118,8 +118,16 @@ impl Name { } } Err(err) => { - print_error!("{}: {}.", name, err); - name + match err.kind() { + std::io::ErrorKind::NotFound => { + // If this happens, it just means the file is a broken symlink. This is not an error, and the user is already warned that the symlink is broken by the colors. + name + } + _ => { + print_error!("{}: {}", name, err); + name + } + } } } }