From 92352f97ad966df29cbac117b9c9ca6a697676f4 Mon Sep 17 00:00:00 2001 From: tidely <43219534+tidely@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:34:52 +0300 Subject: [PATCH] Fix `clippy::map_clone` lint violations (#36585) #36577 Release Notes: - N/A --- Cargo.toml | 1 + crates/git_ui/src/git_panel.rs | 2 +- crates/gpui/src/platform/linux/x11/client.rs | 2 +- crates/workspace/src/pane.rs | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9cd206cebf..a049940772 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -879,6 +879,7 @@ manual_pattern_char_comparison = "warn" manual_rotate = "warn" manual_slice_fill = "warn" manual_while_let_some = "warn" +map_clone = "warn" map_collect_result_unit = "warn" match_like_matches_macro = "warn" match_overlapping_arm = "warn" diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 79d182eb22..cc947bcb72 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -1335,7 +1335,7 @@ impl GitPanel { section.contains(status_entry, repository) && status_entry.staging.as_bool() != Some(goal_staged_state) }) - .map(|status_entry| status_entry.clone()) + .cloned() .collect::>(); (goal_staged_state, entries) diff --git a/crates/gpui/src/platform/linux/x11/client.rs b/crates/gpui/src/platform/linux/x11/client.rs index d501170892..9a43bd6470 100644 --- a/crates/gpui/src/platform/linux/x11/client.rs +++ b/crates/gpui/src/platform/linux/x11/client.rs @@ -2108,7 +2108,7 @@ fn current_pointer_device_states( .classes .iter() .filter_map(|class| class.data.as_scroll()) - .map(|class| *class) + .copied() .rev() .collect::>(); let old_state = scroll_values_to_preserve.get(&info.deviceid); diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index dea18ddbe2..23c8c0b185 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -3082,7 +3082,7 @@ impl Pane { .read(cx) .items() .find(|item| item.item_id() == item_id) - .map(|item| item.clone()) + .cloned() else { return; };