add explicit_iter_loop clippy lint (#8570)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-06-03 20:14:50 +02:00
committed by GitHub
parent 6e446084f0
commit 2b4fa96065
47 changed files with 79 additions and 78 deletions

View File

@ -299,7 +299,7 @@ fn parse_metric_fields(node: &DeriveInput) -> Result<Vec<MetricField<'_>>> {
};
let mut metrics = Vec::with_capacity(data.fields.len());
for field in data.fields.iter() {
for field in &data.fields {
let (mut describe, mut rename, mut skip) = (None, None, false);
if let Some(metric_attr) = parse_single_attr(field, "metric")? {
let parsed =
@ -404,7 +404,7 @@ fn parse_single_required_attr<'a, T: WithAttrs + ToTokens>(
fn parse_docs_to_string<T: WithAttrs>(token: &T) -> Result<Option<String>> {
let mut doc_str = None;
for attr in token.attrs().iter() {
for attr in token.attrs() {
if let syn::Meta::NameValue(ref meta) = attr.meta {
if let Expr::Lit(ref lit) = meta.value {
if let Lit::Str(ref doc) = lit.lit {