From d7f3d858add197f91969c69b1d4a14dbcb801f03 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sun, 19 Apr 2020 15:15:49 -0400 Subject: Some clippy fixes --- crates/ra_hir_def/src/body/lower.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 82a52804d..0caedd8d8 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -473,16 +473,14 @@ impl ExprCollector<'_> { self.collect_block_items(&block); let statements = block .statements() - .filter_map(|s| match s { + .map(|s| match s { ast::Stmt::LetStmt(stmt) => { let pat = self.collect_pat_opt(stmt.pat()); let type_ref = stmt.ascribed_type().map(TypeRef::from_ast); let initializer = stmt.initializer().map(|e| self.collect_expr(e)); - Some(Statement::Let { pat, type_ref, initializer }) - } - ast::Stmt::ExprStmt(stmt) => { - Some(Statement::Expr(self.collect_expr_opt(stmt.expr()))) + Statement::Let { pat, type_ref, initializer } } + ast::Stmt::ExprStmt(stmt) => Statement::Expr(self.collect_expr_opt(stmt.expr())), }) .collect(); let tail = block.expr().map(|e| self.collect_expr(e)); -- cgit v1.2.3