mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Replace Node's broken impl of cmp:Eq with a generic implementation for cow::Handle.
This commit is contained in:
parent
af5985b6e2
commit
9c982693e1
2 changed files with 5 additions and 14 deletions
|
@ -133,6 +133,11 @@ impl<T:Send,A> Handle<T,A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl <T: Send,A> Handle<T,A> : cmp::Eq {
|
||||||
|
pure fn eq(other: &Handle<T,A>) -> bool { *self == **other }
|
||||||
|
pure fn ne(other: &Handle<T,A>) -> bool { *self != **other }
|
||||||
|
}
|
||||||
|
|
||||||
// Private methods
|
// Private methods
|
||||||
impl<T: Copy Send,A> Scope<T,A> {
|
impl<T: Copy Send,A> Scope<T,A> {
|
||||||
fn clone(v: *T) -> *T unsafe {
|
fn clone(v: *T) -> *T unsafe {
|
||||||
|
|
|
@ -48,20 +48,6 @@ impl Node {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: LayoutData is just a pointer, but we must circumvent the type
|
|
||||||
system to actually compare the pointers. This should be fixed in
|
|
||||||
with a generic implementation of cow::Handle */
|
|
||||||
impl Node : cmp::Eq {
|
|
||||||
pure fn eq(other : &Node) -> bool unsafe {
|
|
||||||
let my_data : @LayoutData = @self.aux(|a| copy *a);
|
|
||||||
let ot_data : @LayoutData = @other.aux(|a| copy *a);
|
|
||||||
core::box::ptr_eq(my_data, ot_data)
|
|
||||||
}
|
|
||||||
pure fn ne(other : &Node) -> bool unsafe {
|
|
||||||
!self.eq(other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Node : DebugMethods {
|
impl Node : DebugMethods {
|
||||||
/* Dumps the subtree rooted at this node, for debugging. */
|
/* Dumps the subtree rooted at this node, for debugging. */
|
||||||
fn dump(&self) {
|
fn dump(&self) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue