Rollup merge of #145401 - estebank:remove-useless-iter, r=compiler-errors

cleanup: Remove useless `[T].iter().last()`
This commit is contained in:
Jakub Beránek 2025-08-14 21:48:47 +02:00 committed by GitHub
commit 603ee15f7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -1741,7 +1741,7 @@ fn deny_equality_constraints(
.map(|segment| segment.ident.name)
.zip(poly.trait_ref.path.segments.iter().map(|segment| segment.ident.name))
.all(|(a, b)| a == b)
&& let Some(potential_assoc) = full_path.segments.iter().last()
&& let Some(potential_assoc) = full_path.segments.last()
{
suggest(poly, potential_assoc, predicate);
}

View file

@ -146,7 +146,7 @@ impl<'ty> FieldInnerTy<'ty> {
};
let path = &ty_path.path;
let ty = path.segments.iter().last().unwrap();
let ty = path.segments.last().unwrap();
let syn::PathArguments::AngleBracketed(bracketed) = &ty.arguments else {
panic!("expected bracketed generic arguments");
};