diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-12 17:29:20 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-12 17:29:20 +0000 |
commit | 10f633283180d513138d0d969eceba96e3ce9f96 (patch) | |
tree | e53212d4569e73c7337bb205e937174f425fda5b /crates/assists/src | |
parent | 479d1f7eec22c3564867223e2093f14774092528 (diff) | |
parent | 26a1675764c9f96cc96d75d2129dd6c828b8df51 (diff) |
Merge #6846
6846: Remove some redundant allocations r=kjeremy a=kjeremy
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/assists/src')
-rw-r--r-- | crates/assists/src/handlers/extract_struct_from_enum_variant.rs | 2 | ||||
-rw-r--r-- | crates/assists/src/handlers/qualify_path.rs | 2 |
2 files changed, 2 insertions, 2 deletions
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( | |||
212 | find_node_at_offset::<ast::PathExpr>(source_file.syntax(), offset) | 212 | find_node_at_offset::<ast::PathExpr>(source_file.syntax(), offset) |
213 | { | 213 | { |
214 | // tuple variant | 214 | // tuple variant |
215 | (path_expr.path()?.segment()?, path_expr.syntax().parent()?.clone()) | 215 | (path_expr.path()?.segment()?, path_expr.syntax().parent()?) |
216 | } else if let Some(record_expr) = | 216 | } else if let Some(record_expr) = |
217 | find_node_at_offset::<ast::RecordExpr>(source_file.syntax(), offset) | 217 | find_node_at_offset::<ast::RecordExpr>(source_file.syntax(), offset) |
218 | { | 218 | { |
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<'_> { | |||
150 | import, | 150 | import, |
151 | trait_method_name, | 151 | trait_method_name, |
152 | generics, | 152 | generics, |
153 | match arg_list.clone() { | 153 | match arg_list { |
154 | Some(args) => make::arg_list(iter::once(receiver).chain(args)), | 154 | Some(args) => make::arg_list(iter::once(receiver).chain(args)), |
155 | None => make::arg_list(iter::once(receiver)), | 155 | None => make::arg_list(iter::once(receiver)), |
156 | } | 156 | } |