Use == instead of match for tests against a single enum value

The performance of using == should now equal that of match, so many
identity methods can be simplified to a single line.

Fixes #1596.
This commit is contained in:
Martin Robinson 2014-05-08 13:27:59 -07:00
parent 6d381959db
commit 300004f3e9
75 changed files with 80 additions and 316 deletions

View file

@ -40,12 +40,9 @@ impl Reflectable for XMLHttpRequestUpload {
impl XMLHttpRequestUploadDerived for EventTarget {
fn is_xmlhttprequestupload(&self) -> bool {
match self.type_id {
XMLHttpRequestTargetTypeId(XMLHttpRequestUploadTypeId) => true,
_ => false
}
self.type_id == XMLHttpRequestTargetTypeId(XMLHttpRequestUploadTypeId)
}
}
pub trait XMLHttpRequestUploadMethods {
}
}