diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index bae5f259fcc..db8555edd0f 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -288,7 +288,7 @@ fn decode(d: &mut D) -> Rc { impl> Encodable for [T] { default fn encode(&self, s: &mut S) { s.emit_usize(self.len()); - for e in self.iter() { + for e in self { e.encode(s); } } @@ -527,7 +527,7 @@ fn decode(d: &mut D) -> ThinVec { impl> Encodable for VecDeque { fn encode(&self, s: &mut S) { s.emit_usize(self.len()); - for e in self.iter() { + for e in self { e.encode(s); } } @@ -547,7 +547,7 @@ impl Encodable for BTreeMap { fn encode(&self, e: &mut S) { e.emit_usize(self.len()); - for (key, val) in self.iter() { + for (key, val) in self { key.encode(e); val.encode(e); } @@ -571,7 +571,7 @@ impl Encodable for BTreeSet { fn encode(&self, s: &mut S) { s.emit_usize(self.len()); - for e in self.iter() { + for e in self { e.encode(s); } } @@ -595,7 +595,7 @@ impl Encodable for HashMap { fn encode(&self, e: &mut E) { e.emit_usize(self.len()); - for (key, val) in self.iter() { + for (key, val) in self { key.encode(e); val.encode(e); } @@ -621,7 +621,7 @@ impl Encodable for HashSet { fn encode(&self, s: &mut E) { s.emit_usize(self.len()); - for e in self.iter() { + for e in self { e.encode(s); } } @@ -646,7 +646,7 @@ impl Encodable for indexmap::IndexMap { fn encode(&self, e: &mut E) { e.emit_usize(self.len()); - for (key, val) in self.iter() { + for (key, val) in self { key.encode(e); val.encode(e); } @@ -672,7 +672,7 @@ impl Encodable for indexmap::IndexSet { fn encode(&self, s: &mut E) { s.emit_usize(self.len()); - for e in self.iter() { + for e in self { e.encode(s); } }