Skip to content

Commit

Permalink
Simplify PartialEq implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
powergee committed Sep 30, 2024
1 parent 97e7a22 commit c243aa2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/strong.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,7 @@ impl<T: RcObject> Drop for Rc<T> {
impl<T: RcObject + PartialEq> PartialEq for Rc<T> {
#[inline(always)]
fn eq(&self, other: &Self) -> bool {
match (self.as_ref(), other.as_ref()) {
(None, None) => true,
(Some(x), Some(y)) => x.eq(y),
(_, _) => false,
}
self.as_ref() == other.as_ref()
}
}

Expand Down Expand Up @@ -895,11 +891,7 @@ impl<'g, T: RcObject> Default for Snapshot<'g, T> {
impl<'g, T: RcObject + PartialEq> PartialEq for Snapshot<'g, T> {
#[inline(always)]
fn eq(&self, other: &Self) -> bool {
match (self.as_ref(), other.as_ref()) {
(None, None) => true,
(Some(x), Some(y)) => x.eq(y),
(_, _) => false,
}
self.as_ref() == other.as_ref()
}
}

Expand Down

0 comments on commit c243aa2

Please sign in to comment.