Fix explicit_iter_loop in rustc_serialize

This commit is contained in:
Michal Piotrowski 2024-10-16 15:44:16 +02:00
parent d829780c4e
commit b2b4ad4cc9
No known key found for this signature in database
GPG Key ID: 2538DC6C8E7C7859

View File

@ -288,7 +288,7 @@ fn decode(d: &mut D) -> Rc<T> {
impl<S: Encoder, T: Encodable<S>> Encodable<S> for [T] { impl<S: Encoder, T: Encodable<S>> Encodable<S> for [T] {
default fn encode(&self, s: &mut S) { default fn encode(&self, s: &mut S) {
s.emit_usize(self.len()); s.emit_usize(self.len());
for e in self.iter() { for e in self {
e.encode(s); e.encode(s);
} }
} }
@ -527,7 +527,7 @@ fn decode(d: &mut D) -> ThinVec<T> {
impl<S: Encoder, T: Encodable<S>> Encodable<S> for VecDeque<T> { impl<S: Encoder, T: Encodable<S>> Encodable<S> for VecDeque<T> {
fn encode(&self, s: &mut S) { fn encode(&self, s: &mut S) {
s.emit_usize(self.len()); s.emit_usize(self.len());
for e in self.iter() { for e in self {
e.encode(s); e.encode(s);
} }
} }
@ -547,7 +547,7 @@ impl<S: Encoder, K, V> Encodable<S> for BTreeMap<K, V>
{ {
fn encode(&self, e: &mut S) { fn encode(&self, e: &mut S) {
e.emit_usize(self.len()); e.emit_usize(self.len());
for (key, val) in self.iter() { for (key, val) in self {
key.encode(e); key.encode(e);
val.encode(e); val.encode(e);
} }
@ -571,7 +571,7 @@ impl<S: Encoder, T> Encodable<S> for BTreeSet<T>
{ {
fn encode(&self, s: &mut S) { fn encode(&self, s: &mut S) {
s.emit_usize(self.len()); s.emit_usize(self.len());
for e in self.iter() { for e in self {
e.encode(s); e.encode(s);
} }
} }
@ -595,7 +595,7 @@ impl<E: Encoder, K, V, S> Encodable<E> for HashMap<K, V, S>
{ {
fn encode(&self, e: &mut E) { fn encode(&self, e: &mut E) {
e.emit_usize(self.len()); e.emit_usize(self.len());
for (key, val) in self.iter() { for (key, val) in self {
key.encode(e); key.encode(e);
val.encode(e); val.encode(e);
} }
@ -621,7 +621,7 @@ impl<E: Encoder, T, S> Encodable<E> for HashSet<T, S>
{ {
fn encode(&self, s: &mut E) { fn encode(&self, s: &mut E) {
s.emit_usize(self.len()); s.emit_usize(self.len());
for e in self.iter() { for e in self {
e.encode(s); e.encode(s);
} }
} }
@ -646,7 +646,7 @@ impl<E: Encoder, K, V, S> Encodable<E> for indexmap::IndexMap<K, V, S>
{ {
fn encode(&self, e: &mut E) { fn encode(&self, e: &mut E) {
e.emit_usize(self.len()); e.emit_usize(self.len());
for (key, val) in self.iter() { for (key, val) in self {
key.encode(e); key.encode(e);
val.encode(e); val.encode(e);
} }
@ -672,7 +672,7 @@ impl<E: Encoder, T, S> Encodable<E> for indexmap::IndexSet<T, S>
{ {
fn encode(&self, s: &mut E) { fn encode(&self, s: &mut E) {
s.emit_usize(self.len()); s.emit_usize(self.len());
for e in self.iter() { for e in self {
e.encode(s); e.encode(s);
} }
} }