aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-02 09:07:42 +0100
committerGitHub <[email protected]>2020-10-02 09:07:42 +0100
commite535489f03901ab94a89dd2de67f35714f0c3cfc (patch)
treef3e70f9a42b29d3d01448cc298dc61a0bce04294 /crates/assists/src
parentc3bf7659b13a14541ddcff9c243c79b45bfd6829 (diff)
parent82d6cfd495c7e0f230ce1ac61e7a4297fa22f02f (diff)
Merge #6104
6104: Minor clippy performance suggestions r=matklad a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/assists/src')
-rw-r--r--crates/assists/src/handlers/add_missing_impl_members.rs2
-rw-r--r--crates/assists/src/handlers/extract_struct_from_enum_variant.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs
index 1ac5fefd6..51b5a2eb0 100644
--- a/crates/assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/assists/src/handlers/add_missing_impl_members.rs
@@ -146,7 +146,7 @@ fn add_missing_impl_members_inner(
146 146
147 let target = impl_def.syntax().text_range(); 147 let target = impl_def.syntax().text_range();
148 acc.add(AssistId(assist_id, AssistKind::QuickFix), label, target, |builder| { 148 acc.add(AssistId(assist_id, AssistKind::QuickFix), label, target, |builder| {
149 let impl_item_list = impl_def.assoc_item_list().unwrap_or(make::assoc_item_list()); 149 let impl_item_list = impl_def.assoc_item_list().unwrap_or_else(make::assoc_item_list);
150 150
151 let n_existing_items = impl_item_list.assoc_items().count(); 151 let n_existing_items = impl_item_list.assoc_items().count();
152 let source_scope = ctx.sema.scope_for_def(trait_); 152 let source_scope = ctx.sema.scope_for_def(trait_);
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 d1eadaa99..f5f03ef36 100644
--- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -91,7 +91,7 @@ fn existing_struct_def(db: &RootDatabase, variant_name: &str, variant: &EnumVari
91 .module(db) 91 .module(db)
92 .scope(db, None) 92 .scope(db, None)
93 .into_iter() 93 .into_iter()
94 .any(|(name, _)| name.to_string() == variant_name.to_string()) 94 .any(|(name, _)| name.to_string() == variant_name)
95} 95}
96 96
97#[allow(dead_code)] 97#[allow(dead_code)]