aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-19 20:19:41 +0100
committerGitHub <[email protected]>2020-04-19 20:19:41 +0100
commit90f837829d4f2c1054751de2de695ba1c0b8ae5c (patch)
tree87de3a5aeb55aabd3bd14ba7132d69751db0bb24 /crates/ra_hir_def
parent24af351018f2aeb11a2fb8cabb551798a5ab695e (diff)
parentd7f3d858add197f91969c69b1d4a14dbcb801f03 (diff)
Merge #4047
4047: Some clippy fixes r=matklad a=kjeremy Mostly removes redundant `clone` and `into` Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs8
1 files changed, 3 insertions, 5 deletions
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<'_> {
473 self.collect_block_items(&block); 473 self.collect_block_items(&block);
474 let statements = block 474 let statements = block
475 .statements() 475 .statements()
476 .filter_map(|s| match s { 476 .map(|s| match s {
477 ast::Stmt::LetStmt(stmt) => { 477 ast::Stmt::LetStmt(stmt) => {
478 let pat = self.collect_pat_opt(stmt.pat()); 478 let pat = self.collect_pat_opt(stmt.pat());
479 let type_ref = stmt.ascribed_type().map(TypeRef::from_ast); 479 let type_ref = stmt.ascribed_type().map(TypeRef::from_ast);
480 let initializer = stmt.initializer().map(|e| self.collect_expr(e)); 480 let initializer = stmt.initializer().map(|e| self.collect_expr(e));
481 Some(Statement::Let { pat, type_ref, initializer }) 481 Statement::Let { pat, type_ref, initializer }
482 }
483 ast::Stmt::ExprStmt(stmt) => {
484 Some(Statement::Expr(self.collect_expr_opt(stmt.expr())))
485 } 482 }
483 ast::Stmt::ExprStmt(stmt) => Statement::Expr(self.collect_expr_opt(stmt.expr())),
486 }) 484 })
487 .collect(); 485 .collect();
488 let tail = block.expr().map(|e| self.collect_expr(e)); 486 let tail = block.expr().map(|e| self.collect_expr(e));