Skip to content

Commit 382c964

Browse files
committed
small clean-up
1 parent af7fa53 commit 382c964

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clippy_lints/src/lifetimes.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ fn report_elidable_impl_lifetimes<'tcx>(
745745
impl_: &'tcx Impl<'_>,
746746
map: &FxIndexMap<LocalDefId, Vec<Usage>>,
747747
) {
748-
let single_usages = map
748+
let (elidable_lts, usages): (Vec<_>, Vec<_>) = map
749749
.iter()
750750
.filter_map(|(def_id, usages)| {
751751
if let [
@@ -762,14 +762,12 @@ fn report_elidable_impl_lifetimes<'tcx>(
762762
None
763763
}
764764
})
765-
.collect::<Vec<_>>();
765+
.unzip();
766766

767-
if single_usages.is_empty() {
767+
if elidable_lts.is_empty() {
768768
return;
769769
}
770770

771-
let (elidable_lts, usages): (Vec<_>, Vec<_>) = single_usages.into_iter().unzip();
772-
773771
report_elidable_lifetimes(cx, impl_.generics, &elidable_lts, &usages, true);
774772
}
775773

@@ -795,9 +793,7 @@ fn report_elidable_lifetimes(
795793
// In principle, the result of the call to `Node::ident` could be `unwrap`ped, as `DefId` should refer to a
796794
// `Node::GenericParam`.
797795
.filter_map(|&def_id| cx.tcx.hir_node_by_def_id(def_id).ident())
798-
.map(|ident| ident.to_string())
799-
.collect::<Vec<_>>()
800-
.join(", ");
796+
.format(", ");
801797

802798
let elidable_usages: Vec<ElidableUsage> = usages
803799
.iter()

0 commit comments

Comments
 (0)