6802: Minor, more orthogonal code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-12-10 15:32:23 +00:00 committed by GitHub
commit 5a6065e3b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,13 +145,11 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()
})
.filter(|(mod_path, _)| mod_path.len() > 1)
.filter_map(|(import_path, definition)| {
let ie =
ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone() };
{
let _p = profile::span("totextedit");
ie.to_text_edit(ctx.config.merge);
}
render_resolution_with_import(RenderContext::new(ctx), ie, &definition)
render_resolution_with_import(
RenderContext::new(ctx),
ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone() },
&definition,
)
});
acc.add_all(possible_imports);