Consolidate redundant code

This commit is contained in:
Hanno Braun 2025-04-04 12:16:41 +02:00
parent 18e98b0d0b
commit 1611a250f2

View File

@ -32,8 +32,8 @@ impl<T> Eq for Handle<T> {}
impl<T> Ord for Handle<T> {
fn cmp(&self, other: &Self) -> Ordering {
let self_ptr = Rc::as_ptr(&self.inner);
let other_ptr = Rc::as_ptr(&other.inner);
let [self_ptr, other_ptr] =
[self, other].map(|handle| Rc::as_ptr(&handle.inner));
self_ptr.cmp(&other_ptr)
}