remove unnecessary lifetimes that can be elided

This commit is contained in:
Daniel Eades 2022-12-30 09:00:42 +00:00
parent 8615bba105
commit 4f8ffd0ba4
11 changed files with 49 additions and 63 deletions

View file

@ -55,10 +55,7 @@ impl TraitEnvironment {
}
}
pub fn traits_in_scope_from_clauses<'a>(
&'a self,
ty: Ty,
) -> impl Iterator<Item = TraitId> + 'a {
pub fn traits_in_scope_from_clauses(&self, ty: Ty) -> impl Iterator<Item = TraitId> + '_ {
self.traits_from_clauses
.iter()
.filter_map(move |(self_ty, trait_id)| (*self_ty == ty).then_some(*trait_id))