Implement ptr_eq on the context types.
This commit is contained in:
@@ -64,4 +64,12 @@ impl<T: Debug> List<T> {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.head.is_none()
|
||||
}
|
||||
|
||||
pub fn ptr_eq(&self, other: &List<T>) -> bool {
|
||||
match (self.head.as_ref(), other.head.as_ref()) {
|
||||
(None, None) => true,
|
||||
(None, Some(_)) | (Some(_), None) => false,
|
||||
(Some(me), Some(them)) => Rc::ptr_eq(me, them),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user