mirror of
https://github.com/lsd-rs/lsd.git
synced 2026-02-23 07:33:18 +02:00
refactor(display): remove unnecessary String clone
This commit is contained in:
committed by
Abin Simon
parent
a9bbab821e
commit
ffa5b2bfaf
@@ -100,14 +100,12 @@ fn inner_display_grid(
|
||||
);
|
||||
|
||||
for block in blocks {
|
||||
let block_str = block.to_string();
|
||||
|
||||
cells.push(Cell {
|
||||
width: get_visible_width(
|
||||
&block_str,
|
||||
&block,
|
||||
matches!(flags.hyperlink, HyperlinkOption::Always),
|
||||
),
|
||||
contents: block_str,
|
||||
contents: block,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -235,14 +233,12 @@ fn inner_display_tree(
|
||||
padding_rules,
|
||||
(tree_index, ¤t_prefix),
|
||||
) {
|
||||
let block_str = block.to_string();
|
||||
|
||||
cells.push(Cell {
|
||||
width: get_visible_width(
|
||||
&block_str,
|
||||
&block,
|
||||
matches!(flags.hyperlink, HyperlinkOption::Always),
|
||||
),
|
||||
contents: block_str,
|
||||
contents: block,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user