mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Remove redundant clones
This commit is contained in:
parent
ae7bee70a1
commit
79d103d5b4
7 changed files with 8 additions and 17 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue