From 79d103d5b42c5b207c28b6eb8a6ab42f0c685ec5 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Fri, 5 Feb 2021 16:57:26 +0100 Subject: Remove redundant clones --- crates/hir_def/src/body/lower.rs | 2 +- crates/hir_def/src/data.rs | 2 +- crates/hir_def/src/test_db.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 28b11cdde..c18001e15 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -712,7 +712,7 @@ impl ExprCollector<'_> { let statements = block.statements().filter_map(|s| self.collect_stmt(s)).flatten().collect(); let tail = block.tail_expr().map(|e| self.collect_expr(e)); - let syntax_node_ptr = AstPtr::new(&block.clone().into()); + let syntax_node_ptr = AstPtr::new(&block.into()); let expr_id = self.alloc_expr( Expr::Block { id: block_id, statements, tail, label: None }, syntax_node_ptr, diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs index 42fcca386..d3380e0f4 100644 --- a/crates/hir_def/src/data.rs +++ b/crates/hir_def/src/data.rs @@ -43,7 +43,7 @@ impl FunctionData { name: func.name.clone(), params: func.params.iter().map(|id| item_tree[*id].clone()).collect(), ret_type: item_tree[func.ret_type].clone(), - attrs: item_tree.attrs(db, krate, ModItem::from(loc.id.value).into()).clone(), + attrs: item_tree.attrs(db, krate, ModItem::from(loc.id.value).into()), has_self_param: func.has_self_param, has_body: func.has_body, is_unsafe: func.is_unsafe, diff --git a/crates/hir_def/src/test_db.rs b/crates/hir_def/src/test_db.rs index c4e36eda5..6665d902d 100644 --- a/crates/hir_def/src/test_db.rs +++ b/crates/hir_def/src/test_db.rs @@ -161,7 +161,7 @@ impl TestDB { let node = src.map(|ptr| ptr.to_node(&root)); let frange = node.as_ref().original_file_range(db); - let message = d.message().to_owned(); + let message = d.message(); actual.entry(frange.file_id).or_default().push((frange.range, message)); }); -- cgit v1.2.3