servo: Merge #14466 - Remove a pointless match block in XMLHttpRequest::initiate_async_xhr (from servo:xhr-match); r=frewsxcv
authorMs2ger <Ms2ger@gmail.com>
Mon, 05 Dec 2016 16:00:22 -0800
changeset 340346 ebd81fd08e0bef9c019af6a8c9a0de966d5a0d55
parent 340345 f42f9eba6e516b7d09e402cfe8aa34d529ce35db
child 340347 072ec4f91670aa29b2b1729955efd91687f215fa
push id86548
push userkwierso@gmail.com
push dateSat, 04 Feb 2017 01:35:21 +0000
treeherdermozilla-inbound@e7b96d015d03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrewsxcv
servo: Merge #14466 - Remove a pointless match block in XMLHttpRequest::initiate_async_xhr (from servo:xhr-match); r=frewsxcv Source-Repo: https://github.com/servo/servo Source-Revision: 75418b70054664634f8f69e636f84e7e4e2731ed
servo/components/script/dom/xmlhttprequest.rs
--- a/servo/components/script/dom/xmlhttprequest.rs
+++ b/servo/components/script/dom/xmlhttprequest.rs
@@ -235,24 +235,17 @@ impl XMLHttpRequest {
             }
 
             fn process_response_chunk(&mut self, mut chunk: Vec<u8>) {
                 self.buf.borrow_mut().append(&mut chunk);
                 self.xhr.root().process_data_available(self.gen_id, self.buf.borrow().clone());
             }
 
             fn process_response_eof(&mut self, response: Result<(), NetworkError>) {
-                let rv = match response {
-                    Ok(()) => {
-                        self.xhr.root().process_response_complete(self.gen_id, Ok(()))
-                    }
-                    Err(e) => {
-                        self.xhr.root().process_response_complete(self.gen_id, Err(e))
-                    }
-                };
+                let rv = self.xhr.root().process_response_complete(self.gen_id, response);
                 *self.sync_status.borrow_mut() = Some(rv);
             }
         }
 
         impl PreInvoke for XHRContext {
             fn should_invoke(&self) -> bool {
                 self.xhr.root().generation_id.get() == self.gen_id
             }