Fix clippy lint about looping over iter()
This commit is contained in:
parent
b289edd4a4
commit
d0502b93ef
@ -157,7 +157,7 @@ impl<T> Serialize for [T]
|
||||
where S: Serializer,
|
||||
{
|
||||
let mut state = try!(serializer.serialize_seq(Some(self.len())));
|
||||
for e in self.iter() {
|
||||
for e in self {
|
||||
try!(serializer.serialize_seq_elt(&mut state, e));
|
||||
}
|
||||
serializer.serialize_seq_end(state)
|
||||
@ -174,7 +174,7 @@ macro_rules! array_impls {
|
||||
where S: Serializer,
|
||||
{
|
||||
let mut state = try!(serializer.serialize_seq_fixed_size($len));
|
||||
for e in self.iter() {
|
||||
for e in self {
|
||||
try!(serializer.serialize_seq_elt(&mut state, e));
|
||||
}
|
||||
serializer.serialize_seq_end(state)
|
||||
|
@ -382,7 +382,7 @@ fn serialize_variant(
|
||||
}
|
||||
Style::Struct => {
|
||||
let mut pat = builder.pat().struct_().id(type_ident).id(variant_ident).build();
|
||||
for field in variant.fields.iter() {
|
||||
for field in &variant.fields {
|
||||
let name = match field.ident {
|
||||
Some(name) => name,
|
||||
None => cx.span_bug(field.span, "struct variant has unnamed fields"),
|
||||
|
Loading…
Reference in New Issue
Block a user