From 26a1675764c9f96cc96d75d2129dd6c828b8df51 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 12 Dec 2020 12:27:09 -0500 Subject: Remove some redundant allocations --- crates/assists/src/handlers/extract_struct_from_enum_variant.rs | 2 +- crates/assists/src/handlers/qualify_path.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs index d85767b4e..2e56bd7ff 100644 --- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs @@ -212,7 +212,7 @@ fn update_reference( find_node_at_offset::(source_file.syntax(), offset) { // tuple variant - (path_expr.path()?.segment()?, path_expr.syntax().parent()?.clone()) + (path_expr.path()?.segment()?, path_expr.syntax().parent()?) } else if let Some(record_expr) = find_node_at_offset::(source_file.syntax(), offset) { diff --git a/crates/assists/src/handlers/qualify_path.rs b/crates/assists/src/handlers/qualify_path.rs index 6f9810fe8..98cb09214 100644 --- a/crates/assists/src/handlers/qualify_path.rs +++ b/crates/assists/src/handlers/qualify_path.rs @@ -150,7 +150,7 @@ impl QualifyCandidate<'_> { import, trait_method_name, generics, - match arg_list.clone() { + match arg_list { Some(args) => make::arg_list(iter::once(receiver).chain(args)), None => make::arg_list(iter::once(receiver)), } -- cgit v1.2.3