Skip to content

Commit

Permalink
all: address clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed May 2, 2024
1 parent 1e24e6c commit 84f7f88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/backends/metal/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
_ => {}
}
Expand Down
6 changes: 5 additions & 1 deletion src/tree/toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ impl<T: ToplevelNodeBase> 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();
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/utils/copyhashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ impl<K: Eq + Hash, V> CopyHashMap<K, V> {
unsafe { self.map.get().deref_mut().insert(k, v) }
}

pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<V>
pub fn get<Q>(&self, k: &Q) -> Option<V>
where
V: UnsafeCellCloneSafe,
Q: Hash + Eq,
Q: Hash + Eq + ?Sized,
K: Borrow<Q>,
{
unsafe { self.map.get().deref().get(k).cloned() }
}

pub fn remove<Q: ?Sized>(&self, k: &Q) -> Option<V>
pub fn remove<Q>(&self, k: &Q) -> Option<V>
where
Q: Hash + Eq,
Q: Hash + Eq + ?Sized,
K: Borrow<Q>,
{
unsafe { self.map.get().deref_mut().remove(k) }
}

pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool
pub fn contains<Q>(&self, k: &Q) -> bool
where
Q: Hash + Eq,
Q: Hash + Eq + ?Sized,
K: Borrow<Q>,
{
unsafe { self.map.get().deref().contains_key(k) }
Expand Down

0 comments on commit 84f7f88

Please sign in to comment.