Skip to content

Commit

Permalink
style: updates for latest clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryConrad committed Dec 1, 2024
1 parent d3c8660 commit 1bbdf47
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions rearch-effects/src/overridable_capsule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ mod dyn_capsule_key {
}

fn dyn_eq(&self, other: &dyn DynCapsuleKey) -> bool {
other
.as_any()
.downcast_ref::<T>()
.map_or(false, |other| self == other)
other.as_any().downcast_ref::<T>() == Some(self)
}
}
impl Hash for dyn DynCapsuleKey {
Expand Down
5 changes: 1 addition & 4 deletions rearch/src/capsule_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ where
}

fn dyn_eq(&self, other: &dyn DynCapsuleKey) -> bool {
other
.as_any()
.downcast_ref::<T>()
.map_or(false, |other| self == other)
other.as_any().downcast_ref::<T>() == Some(self)
}
}
impl Hash for dyn DynCapsuleKey {
Expand Down
2 changes: 1 addition & 1 deletion rearch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ impl CapsuleManager {
.remove(&id)
.as_ref()
.map(downcast_capsule_data::<C>)
.map_or(true, |old_data| !C::eq(old_data, &new_data));
.is_none_or(|old_data| !C::eq(old_data, &new_data));

txn.data.insert(id, Box::new(new_data));

Expand Down

0 comments on commit 1bbdf47

Please sign in to comment.