From 84f7f883997f7c8a381d956ec39778607daf4bcf Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Thu, 2 May 2024 20:00:50 +0200 Subject: [PATCH] all: address clippy lints --- src/backends/metal/video.rs | 4 ++-- src/tree/toplevel.rs | 6 +++++- src/utils/copyhashmap.rs | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/backends/metal/video.rs b/src/backends/metal/video.rs index edf4a611..7fc0531a 100644 --- a/src/backends/metal/video.rs +++ b/src/backends/metal/video.rs @@ -1473,10 +1473,10 @@ fn create_connector_display_data( for descriptor in edid.base_block.descriptors.iter().flatten() { match descriptor { Descriptor::DisplayProductSerialNumber(s) => { - serial_number = s.clone(); + serial_number.clone_from(s); } Descriptor::DisplayProductName(s) => { - name = s.clone(); + name.clone_from(s); } _ => {} } diff --git a/src/tree/toplevel.rs b/src/tree/toplevel.rs index c7d00b97..7aefabe3 100644 --- a/src/tree/toplevel.rs +++ b/src/tree/toplevel.rs @@ -84,7 +84,11 @@ impl ToplevelNode for T { parent.node_child_title_changed(self, &title); } if let Some(data) = data.fullscrceen_data.borrow_mut().deref() { - *data.placeholder.tl_data().title.borrow_mut() = title.clone(); + data.placeholder + .tl_data() + .title + .borrow_mut() + .clone_from(&title); data.placeholder.tl_title_changed(); } } diff --git a/src/utils/copyhashmap.rs b/src/utils/copyhashmap.rs index b56edbc2..a83140ff 100644 --- a/src/utils/copyhashmap.rs +++ b/src/utils/copyhashmap.rs @@ -41,26 +41,26 @@ impl CopyHashMap { unsafe { self.map.get().deref_mut().insert(k, v) } } - pub fn get(&self, k: &Q) -> Option + pub fn get(&self, k: &Q) -> Option where V: UnsafeCellCloneSafe, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, K: Borrow, { unsafe { self.map.get().deref().get(k).cloned() } } - pub fn remove(&self, k: &Q) -> Option + pub fn remove(&self, k: &Q) -> Option where - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, K: Borrow, { unsafe { self.map.get().deref_mut().remove(k) } } - pub fn contains(&self, k: &Q) -> bool + pub fn contains(&self, k: &Q) -> bool where - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, K: Borrow, { unsafe { self.map.get().deref().contains_key(k) }