mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove the custom PartialEq implementations on TypeId enums
https://github.com/rust-lang/rust/pull/33593 made them useless.
This commit is contained in:
parent
2ab7f1366c
commit
60aaac5175
3 changed files with 3 additions and 64 deletions
|
@ -13,7 +13,7 @@ use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
|
|||
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||
use dom::bindings::codegen::UnionTypes::EventOrString;
|
||||
use dom::bindings::error::{Error, Fallible, report_pending_exception};
|
||||
use dom::bindings::inheritance::{Castable, EventTargetTypeId};
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::reflector::{Reflectable, Reflector};
|
||||
use dom::element::Element;
|
||||
|
@ -35,8 +35,8 @@ use std::ffi::CString;
|
|||
use std::hash::BuildHasherDefault;
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
use std::{intrinsics, ptr};
|
||||
use string_cache::Atom;
|
||||
use url::Url;
|
||||
use util::str::DOMString;
|
||||
|
@ -62,42 +62,6 @@ pub enum ListenerPhase {
|
|||
Bubbling,
|
||||
}
|
||||
|
||||
impl PartialEq for EventTargetTypeId {
|
||||
#[inline]
|
||||
fn eq(&self, other: &EventTargetTypeId) -> bool {
|
||||
match (*self, *other) {
|
||||
(EventTargetTypeId::Node(this_type), EventTargetTypeId::Node(other_type)) => {
|
||||
this_type == other_type
|
||||
}
|
||||
_ => self.eq_slow(other)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl EventTargetTypeId {
|
||||
#[allow(unsafe_code)]
|
||||
fn eq_slow(&self, other: &EventTargetTypeId) -> bool {
|
||||
match (*self, *other) {
|
||||
(EventTargetTypeId::Node(this_type), EventTargetTypeId::Node(other_type)) => {
|
||||
this_type == other_type
|
||||
}
|
||||
(EventTargetTypeId::WorkerGlobalScope(this_type),
|
||||
EventTargetTypeId::WorkerGlobalScope(other_type)) => {
|
||||
this_type == other_type
|
||||
}
|
||||
(EventTargetTypeId::XMLHttpRequestEventTarget(this_type),
|
||||
EventTargetTypeId::XMLHttpRequestEventTarget(other_type)) => {
|
||||
this_type == other_type
|
||||
}
|
||||
(_, _) => {
|
||||
unsafe {
|
||||
intrinsics::discriminant_value(self) == intrinsics::discriminant_value(other)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// https://html.spec.whatwg.org/multipage/#internal-raw-uncompiled-handler
|
||||
#[derive(JSTraceable, Clone, PartialEq)]
|
||||
pub struct InternalRawUncompiledHandler {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue