From 5901d580a9f61b0750f78690d838956dcff56c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Sun, 22 Feb 2026 00:42:09 +0800 Subject: [PATCH] editor: Remove redundant clone in `highlight_text` (#49810) Closes #ISSUE Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --- crates/editor/src/display_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/display_map.rs b/crates/editor/src/display_map.rs index 99db360e17bf91c50b3bfa61e338c8785f5c1061..9bdff7776ce3a8fd85750b691f8f719a53a749bd 100644 --- a/crates/editor/src/display_map.rs +++ b/crates/editor/src/display_map.rs @@ -1216,7 +1216,7 @@ impl DisplayMap { let to_insert = match self.text_highlights.remove(&key) { Some(mut previous) if merge => match Arc::get_mut(&mut previous) { Some((_, previous_ranges)) => { - previous_ranges.extend(ranges.iter().cloned()); + previous_ranges.extend(ranges); previous_ranges.sort_by(|a, b| a.start.cmp(&b.start, &multi_buffer_snapshot)); previous }