Skip to content

Commit

Permalink
fixup: new lints from clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldSEnder committed Mar 12, 2024
1 parent 2e6f17f commit 11cbe10
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/yew/src/callback.rs
Expand Up @@ -25,7 +25,9 @@ macro_rules! generate_callback_impls {
}
}

#[allow(clippy::vtable_address_comparisons)]
// We are okay with comparisons from different compilation units to result in false not-equal
// results. This should only lead in the worst-case to some unneeded re-renders.
#[allow(ambiguous_wide_pointer_comparisons)]
impl<IN, OUT> PartialEq for $callback<IN, OUT> {
fn eq(&self, other: &$callback<IN, OUT>) -> bool {
let ($callback { cb }, $callback { cb: rhs_cb }) = (self, other);
Expand Down
4 changes: 3 additions & 1 deletion packages/yew/src/functional/hooks/use_reducer.rs
Expand Up @@ -130,7 +130,9 @@ where
T: Reducible,
{
fn eq(&self, rhs: &Self) -> bool {
#[allow(clippy::vtable_address_comparisons)]
// We are okay with comparisons from different compilation units to result in false not-equal
// results. This should only lead in the worst-case to some unneeded re-renders.
#[allow(ambiguous_wide_pointer_comparisons)]
Rc::ptr_eq(&self.dispatch, &rhs.dispatch)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/yew/src/suspense/suspension.rs
Expand Up @@ -105,7 +105,7 @@ impl Future for Suspension {

let waker = cx.waker().clone();
self.listen(Callback::from(move |_| {
waker.clone().wake();
waker.wake_by_ref();
}));

Poll::Pending
Expand Down
7 changes: 4 additions & 3 deletions packages/yew/src/virtual_dom/listeners.rs
Expand Up @@ -187,9 +187,10 @@ impl PartialEq for Listeners {
lhs.iter()
.zip(rhs.iter())
.all(|(lhs, rhs)| match (lhs, rhs) {
(Some(lhs), Some(rhs)) =>
{
#[allow(clippy::vtable_address_comparisons)]
(Some(lhs), Some(rhs)) => {
// We are okay with comparisons from different compilation units to result in false not-equal
// results. This should only lead in the worst-case to some unneeded re-renders.
#[allow(ambiguous_wide_pointer_comparisons)]
Rc::ptr_eq(lhs, rhs)
}
(None, None) => true,
Expand Down

0 comments on commit 11cbe10

Please sign in to comment.