Skip to content

Commit 2bf8664

Browse files
committed
Refactorings: code cleanup
1 parent aa4e4e8 commit 2bf8664

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

compiler/rustc_ast_lowering/src/delegation/generics.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
147147
// FIXME(fn_delegation): proper support for late bound lifetimes.
148148
self.arena.alloc(hir::Generics {
149149
params,
150-
predicates: self.arena.alloc_from_iter(params.iter().filter_map(|p| {
151-
if matches!(p.kind, hir::GenericParamKind::Lifetime { .. }) {
152-
Some(self.generate_lifetime_predicate(p))
153-
} else {
154-
None
155-
}
156-
})),
150+
predicates: self.arena.alloc_from_iter(
151+
params
152+
.iter()
153+
.filter_map(|p| p.is_lifetime().then(|| self.generate_lifetime_predicate(p))),
154+
),
157155
has_where_clause_predicates: false,
158156
where_clause_span: span,
159157
span,
@@ -258,7 +256,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
258256
}
259257
}
260258
})),
261-
constraints: self.arena.alloc_slice(&[]),
259+
constraints: &[],
262260
parenthesized: hir::GenericArgsParentheses::No,
263261
span_ext: DUMMY_SP,
264262
})

0 commit comments

Comments
 (0)