diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-04 19:59:21 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-04 19:59:21 +0000 |
commit | de046bf4572a75cf534a2342358a422b2f18d01c (patch) | |
tree | 87f58e72537569806e689a6be4c404a496431360 /crates/completion/src/completions | |
parent | 4c1fcda0f8183060de5a341fffa2b30e65bdb52f (diff) | |
parent | 5d99ba1d9a5acf02a5cd50e456f164bd80b523b5 (diff) |
Merge #7559
7559: Make `ModPath`'s representation private r=jonas-schievink a=jonas-schievink
This lets us switch out the `Vec` for something more efficient
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/completion/src/completions')
-rw-r--r-- | crates/completion/src/completions/flyimport.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/completion/src/completions/flyimport.rs b/crates/completion/src/completions/flyimport.rs index 9c6a5a40c..c9f928483 100644 --- a/crates/completion/src/completions/flyimport.rs +++ b/crates/completion/src/completions/flyimport.rs | |||
@@ -175,7 +175,7 @@ fn compute_fuzzy_completion_order_key( | |||
175 | user_input_lowercased: &str, | 175 | user_input_lowercased: &str, |
176 | ) -> usize { | 176 | ) -> usize { |
177 | mark::hit!(certain_fuzzy_order_test); | 177 | mark::hit!(certain_fuzzy_order_test); |
178 | let proposed_import_name = match proposed_mod_path.segments.last() { | 178 | let proposed_import_name = match proposed_mod_path.segments().last() { |
179 | Some(name) => name.to_string().to_lowercase(), | 179 | Some(name) => name.to_string().to_lowercase(), |
180 | None => return usize::MAX, | 180 | None => return usize::MAX, |
181 | }; | 181 | }; |
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 5d62fab97..e2482f959 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -63,7 +63,7 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T | |||
63 | if let Some(path) = module.find_use_path(ctx.db, ModuleDef::from(variant)) { | 63 | if let Some(path) = module.find_use_path(ctx.db, ModuleDef::from(variant)) { |
64 | // Variants with trivial paths are already added by the existing completion logic, | 64 | // Variants with trivial paths are already added by the existing completion logic, |
65 | // so we should avoid adding these twice | 65 | // so we should avoid adding these twice |
66 | if path.segments.len() > 1 { | 66 | if path.segments().len() > 1 { |
67 | acc.add_qualified_enum_variant(ctx, variant, path); | 67 | acc.add_qualified_enum_variant(ctx, variant, path); |
68 | } | 68 | } |
69 | } | 69 | } |