Use into_owned over to_string for Cow<str> (#39024)
This removes unnecessary allocations when the `Cow` is already owned Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
@@ -2865,7 +2865,7 @@ impl Pane {
|
||||
Some(Box::new(zed_actions::workspace::CopyPath)),
|
||||
window.handler_for(&pane, move |_, _, cx| {
|
||||
cx.write_to_clipboard(ClipboardItem::new_string(
|
||||
abs_path.to_string_lossy().to_string(),
|
||||
abs_path.to_string_lossy().into_owned(),
|
||||
));
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user