Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/render/struct_literal.rs')
| -rw-r--r-- | crates/ide_completion/src/render/struct_literal.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide_completion/src/render/struct_literal.rs b/crates/ide_completion/src/render/struct_literal.rs index 68871a4671..810b51effd 100644 --- a/crates/ide_completion/src/render/struct_literal.rs +++ b/crates/ide_completion/src/render/struct_literal.rs @@ -38,10 +38,9 @@ fn build_completion( .set_documentation(ctx.docs(def)) .set_deprecated(ctx.is_deprecated(def)) .detail(&literal); - if let Some(snippet_cap) = ctx.snippet_cap() { - item.insert_snippet(snippet_cap, literal); - } else { - item.insert_text(literal); + match ctx.snippet_cap() { + Some(snippet_cap) => item.insert_snippet(snippet_cap, literal), + None => item.insert_text(literal), }; item.build() } |