Reduce allocations (#30693)

Removes a unnecessary string conversion and some clones

Release Notes:

- N/A
This commit is contained in:
tidely 2025-05-14 19:29:28 +03:00 committed by GitHub
parent fcfe4e2c14
commit bc99a86bb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 48 additions and 57 deletions

View file

@ -354,8 +354,9 @@ impl PickerDelegate for NewPathDelegate {
let m = self.matches.get(self.selected_index)?;
if m.is_dir(self.project.read(cx), cx) {
let path = m.relative_path();
self.last_selected_dir = Some(path.clone());
Some(format!("{}/", path))
let result = format!("{}/", path);
self.last_selected_dir = Some(path);
Some(result)
} else {
None
}