refactor(display): remove unnecessary String clone

This commit is contained in:
Narawit Rakket
2022-06-13 02:57:33 +07:00
committed by Abin Simon
parent a9bbab821e
commit ffa5b2bfaf

View File

@@ -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, &current_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,
});
}