Skip to content

Commit

Permalink
Implement PartialEq and Hash for PlatformRoot. Not sure about Eq when…
Browse files Browse the repository at this point in the history
… doing pointer comparison on weak references.
  • Loading branch information
mwcampbell committed Feb 23, 2024
1 parent 1bedc27 commit 4d784ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions platforms/atspi-common/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,18 @@ impl PlatformRoot {
}
}

impl PartialEq for PlatformRoot {
fn eq(&self, other: &Self) -> bool {
self.app_context.ptr_eq(&other.app_context)
}
}

impl Hash for PlatformRoot {
fn hash<H: Hasher>(&self, state: &mut H) {
self.app_context.as_ptr().hash(state);
}
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NodeIdOrRoot {
Node(NodeId),
Expand Down

0 comments on commit 4d784ba

Please sign in to comment.