Skip to content

Commit

Permalink
🐎 Avoid unnecessary memory allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Nov 23, 2024
1 parent f286ed3 commit ab829c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/src/command/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ where
header.data_kind(),
DataKind::SymbolicLink | DataKind::HardLink
) {
let path = header.path().to_string();
let original = entry
.reader(ReadOptions::with_password(password))
.map(|r| io::read_to_string(r).unwrap_or_else(|_| "-".into()))
.unwrap_or_default();
format!("{} -> {}", path, original)
format!("{} -> {}", header.path(), original)
} else {
header.path().to_string()
},
Expand Down

0 comments on commit ab829c5

Please sign in to comment.