From d2e8e8e27328ac142d2e52b56f1c2f8518142594 Mon Sep 17 00:00:00 2001 From: ChanTsune <41658782+ChanTsune@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:38:39 +0900 Subject: [PATCH] :racehorse: use `and_then` instead of `map` in `unwrap_or_else` --- cli/src/command/list.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/command/list.rs b/cli/src/command/list.rs index 8b43ed215..af753fe36 100644 --- a/cli/src/command/list.rs +++ b/cli/src/command/list.rs @@ -216,8 +216,8 @@ where DataKind::SymbolicLink | DataKind::HardLink => { let original = entry .reader(ReadOptions::with_password(password)) - .map(|r| io::read_to_string(r).unwrap_or_else(|_| "-".into())) - .unwrap_or_default(); + .and_then(|r| io::read_to_string(r)) + .unwrap_or_else(|_| "-".into()); format!("{} -> {}", header.path(), original) } DataKind::Directory if options.classify => format!("{}/", header.path()),