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:
@@ -170,8 +170,8 @@ fn client_source(abs_path: &Path) -> dap::Source {
|
||||
dap::Source {
|
||||
name: abs_path
|
||||
.file_name()
|
||||
.map(|filename| filename.to_string_lossy().to_string()),
|
||||
path: Some(abs_path.to_string_lossy().to_string()),
|
||||
.map(|filename| filename.to_string_lossy().into_owned()),
|
||||
path: Some(abs_path.to_string_lossy().into_owned()),
|
||||
source_reference: None,
|
||||
presentation_hint: None,
|
||||
origin: None,
|
||||
|
||||
Reference in New Issue
Block a user