mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
implement PartialEq for MutHeap<JS<T>> and MutNullableHeap<JS<T>>
This commit is contained in:
parent
36d5c0b2fb
commit
ab70c8c942
1 changed files with 12 additions and 0 deletions
|
@ -260,6 +260,12 @@ impl<T: HeapGCValue> HeapSizeOf for MutHeap<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> PartialEq for MutHeap<JS<T>> {
|
||||
fn eq(&self, other: &MutHeap<JS<T>>) -> bool {
|
||||
self.get().eq(&other.get())
|
||||
}
|
||||
}
|
||||
|
||||
/// A holder that provides interior mutability for GC-managed values such as
|
||||
/// `JS<T>`, with nullability represented by an enclosing Option wrapper.
|
||||
/// Essentially a `Cell<Option<JS<T>>>`, but safer.
|
||||
|
@ -337,6 +343,12 @@ impl<T: HeapGCValue> HeapSizeOf for MutNullableHeap<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> PartialEq for MutNullableHeap<JS<T>> {
|
||||
fn eq(&self, other: &MutNullableHeap<JS<T>>) -> bool {
|
||||
self.get().eq(&other.get())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> LayoutJS<T> {
|
||||
/// Returns an unsafe pointer to the interior of this JS object. This is
|
||||
/// the only method that be safely accessed from layout. (The fact that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue