Skip to content

Commit 32cfffb

Browse files
authored
style: remove explicit .into_iter() (#1434)
Prevent clippy warnings like: ``` error: explicit call to `.into_iter()` in function argument accepting `IntoIterator` --> prost-derive/src/field/mod.rs:235:21 | 235 | / meta_list 236 | | .parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)? 237 | | .into_iter(), | |____________________________________^ | note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` --> /rustc/59807616e1fa2540724bfbac14d7976d7e4a3860/library/core/src/iter/traits/collect.rs:416:17 = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.95.0/index.html#useless_conversion = note: `-D clippy::useless-conversion` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]` help: consider removing the `.into_iter()` | 236 - .parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)? 237 - .into_iter(), 236 + .parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?, | ```
1 parent 2710efd commit 32cfffb

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

prost-build/src/extern_paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl ExternPaths {
110110
to_snake(segment)
111111
}
112112
})
113-
.chain(ident_type.into_iter())
113+
.chain(ident_type)
114114
.join("::"),
115115
);
116116
}

prost-derive/src/field/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ fn prost_attrs(attrs: Vec<Attribute>) -> Result<Vec<Meta>, Error> {
232232
if let Meta::List(meta_list) = &attr.meta {
233233
if meta_list.path.is_ident("prost") {
234234
result.extend(
235-
meta_list
236-
.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?
237-
.into_iter(),
235+
meta_list.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?,
238236
)
239237
}
240238
}

prost-derive/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,7 @@ fn prost_attrs(attrs: Vec<Attribute>) -> Result<Vec<Meta>, Error> {
533533
if let Meta::List(meta_list) = &attr.meta {
534534
if meta_list.path.is_ident("prost") {
535535
result.extend(
536-
meta_list
537-
.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?
538-
.into_iter(),
536+
meta_list.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?,
539537
)
540538
}
541539
}

0 commit comments

Comments
 (0)