From ab70c8c9421f09df9f705628d405de3109dcefd3 Mon Sep 17 00:00:00 2001 From: Rohan Prinja Date: Wed, 21 Oct 2015 01:40:19 +0900 Subject: [PATCH] implement PartialEq for MutHeap> and MutNullableHeap> --- components/script/dom/bindings/js.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 1ef1d93a86d..7c44555924d 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -260,6 +260,12 @@ impl HeapSizeOf for MutHeap { } } +impl PartialEq for MutHeap> { + fn eq(&self, other: &MutHeap>) -> bool { + self.get().eq(&other.get()) + } +} + /// A holder that provides interior mutability for GC-managed values such as /// `JS`, with nullability represented by an enclosing Option wrapper. /// Essentially a `Cell>>`, but safer. @@ -337,6 +343,12 @@ impl HeapSizeOf for MutNullableHeap { } } +impl PartialEq for MutNullableHeap> { + fn eq(&self, other: &MutNullableHeap>) -> bool { + self.get().eq(&other.get()) + } +} + impl LayoutJS { /// 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