From f4fa98b1bffe2200580506b83af5383555e1a958 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Oct 2019 20:34:30 +0300 Subject: simplify --- crates/ra_ide_api/src/completion/presentation.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 9946db4ca..2d670372e 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs @@ -170,12 +170,13 @@ impl Completions { fn add_adt_with_name(&mut self, ctx: &CompletionContext, name: String, adt: hir::Adt) { let builder = CompletionItem::new(CompletionKind::Reference, ctx.source_range(), name); - let (kind, docs) = match adt { - hir::Adt::Struct(it) => (CompletionItemKind::Struct, it.docs(ctx.db)), + let kind = match adt { + hir::Adt::Struct(_) => CompletionItemKind::Struct, // FIXME: add CompletionItemKind::Union - hir::Adt::Union(it) => (CompletionItemKind::Struct, it.docs(ctx.db)), - hir::Adt::Enum(it) => (CompletionItemKind::Enum, it.docs(ctx.db)), + hir::Adt::Union(_) => CompletionItemKind::Struct, + hir::Adt::Enum(_) => CompletionItemKind::Enum, }; + let docs = adt.docs(ctx.db); builder.kind(kind).set_documentation(docs).add_to(self) } -- cgit v1.2.3