refactor: inline some variables

This commit is contained in:
Artur Sinila 2022-07-17 14:55:21 +03:00
parent a96f0aa7cd
commit 15f73008f8
No known key found for this signature in database
GPG key ID: 770E69D690735C61

View file

@ -80,8 +80,7 @@ pub(super) fn lower(
params: Option<ast::ParamList>,
body: Option<ast::Expr>,
) -> (Body, BodySourceMap) {
let collector = ExprCollector::new(db, expander);
collector.collect(params, body)
ExprCollector::new(db, expander).collect(params, body)
}
struct ExprCollector<'a> {
@ -190,8 +189,7 @@ impl<'a> ExprCollector<'a> {
}
fn collect_expr(&mut self, expr: ast::Expr) -> ExprId {
let expr_id = self.maybe_collect_expr(expr).unwrap_or_else(|| self.missing_expr());
expr_id
self.maybe_collect_expr(expr).unwrap_or_else(|| self.missing_expr())
}
/// Returns `None` if and only if the expression is `#[cfg]`d out.