servo: Merge #2655 - Make some locals immutable (from Ms2ger:warnings); r=jdm
authorMs2ger <ms2ger@gmail.com>
Fri, 13 Jun 2014 18:49:47 -0400
changeset 334526 250989bf342fdf973873a8f24c95fd2bf6a1b46a
parent 334525 b5687abaf36e3a800d26ea6bb76efe422d23b70c
child 334527 a7e4e2a1473dfe0b8a7bf96f709da12efc58a5d9
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
servo: Merge #2655 - Make some locals immutable (from Ms2ger:warnings); r=jdm Source-Repo: https://github.com/servo/servo Source-Revision: dae6ad409d11470c40a922b2083d013893340a31
servo/src/components/script/dom/node.rs
servo/src/components/script/dom/xmlhttprequest.rs
--- a/servo/src/components/script/dom/node.rs
+++ b/servo/src/components/script/dom/node.rs
@@ -1236,17 +1236,17 @@ impl Node {
         }
     }
 
     // http://dom.spec.whatwg.org/#concept-node-clone
     pub fn clone(node: &JSRef<Node>, maybe_doc: Option<&JSRef<Document>>,
                  clone_children: CloneChildrenFlag) -> Temporary<Node> {
 
         // Step 1.
-        let mut document = match maybe_doc {
+        let document = match maybe_doc {
             Some(doc) => JS::from_rooted(doc).root(),
             None => node.owner_doc().root()
         };
 
         // Step 2.
         // XXXabinader: clone() for each node as trait?
         let mut copy: Root<Node> = match node.type_id() {
             DoctypeNodeTypeId => {
--- a/servo/src/components/script/dom/xmlhttprequest.rs
+++ b/servo/src/components/script/dom/xmlhttprequest.rs
@@ -729,19 +729,19 @@ impl<'a> PrivateXMLHttpRequestHelpers fo
                                                                 String::from_str(name.as_slice()),
                                                                 &mut HeaderValueByteIterator::new(&mut reader));
         collection.insert(maybe_header.unwrap());
     }
 
     fn dispatch_progress_event(&self, upload: bool, type_: DOMString, loaded: u64, total: Option<u64>) {
         let win = &*self.global.root();
         let upload_target = &*self.upload.get().root();
-        let mut progressevent = ProgressEvent::new(win, type_, false, false,
-                                                   total.is_some(), loaded,
-                                                   total.unwrap_or(0)).root();
+        let progressevent = ProgressEvent::new(win, type_, false, false,
+                                               total.is_some(), loaded,
+                                               total.unwrap_or(0)).root();
         let target: &JSRef<EventTarget> = if upload {
             EventTargetCast::from_ref(upload_target)
         } else {
             EventTargetCast::from_ref(self)
         };
         let event: &JSRef<Event> = EventCast::from_ref(&*progressevent);
         target.dispatch_event_with_target(None, event).ok();
     }