diff options
author | Martin Robinson <mrobinson@igalia.com> | 2014-05-08 13:27:59 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2014-05-08 17:11:00 -0700 |
commit | 300004f3e9d3759e1d0baf3e2379b8a9d9eeff80 (patch) | |
tree | b69a26960699e167c3349f04019fc6676b342d27 /src/components/script/dom/xmlhttprequestupload.rs | |
parent | 6d381959db18acc5c2f0c1891df8afe5df8372cb (diff) | |
download | servo-300004f3e9d3759e1d0baf3e2379b8a9d9eeff80.tar.gz servo-300004f3e9d3759e1d0baf3e2379b8a9d9eeff80.zip |
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.
Diffstat (limited to 'src/components/script/dom/xmlhttprequestupload.rs')
-rw-r--r-- | src/components/script/dom/xmlhttprequestupload.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/script/dom/xmlhttprequestupload.rs b/src/components/script/dom/xmlhttprequestupload.rs index 6f373ab0a65..bd8dd38c806 100644 --- a/src/components/script/dom/xmlhttprequestupload.rs +++ b/src/components/script/dom/xmlhttprequestupload.rs @@ -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 { -}
\ No newline at end of file +} |