mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove the Comparable trait
This commit is contained in:
parent
7197052c0d
commit
af21229c0e
2 changed files with 2 additions and 24 deletions
|
@ -715,25 +715,3 @@ impl<'a, T: Reflectable> Reflectable for JSRef<'a, T> {
|
|||
(**self).reflector()
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for comparing smart pointers ignoring the lifetimes
|
||||
pub trait Comparable<T> {
|
||||
/// Returns whether the other value points to the same object.
|
||||
fn equals(&self, other: T) -> bool;
|
||||
}
|
||||
|
||||
impl<'a, 'b, T> Comparable<JSRef<'a, T>> for JSRef<'b, T> {
|
||||
fn equals(&self, other: JSRef<'a, T>) -> bool {
|
||||
self.ptr == other.ptr
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b, T> Comparable<Option<JSRef<'a, T>>> for Option<JSRef<'b, T>> {
|
||||
fn equals(&self, other: Option<JSRef<'a, T>>) -> bool {
|
||||
match (*self, other) {
|
||||
(Some(x), Some(y)) => x.ptr == y.ptr,
|
||||
(None, None) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue