Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/render/pattern.rs')
| -rw-r--r-- | crates/ide-completion/src/render/pattern.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ide-completion/src/render/pattern.rs b/crates/ide-completion/src/render/pattern.rs index 124abb17b6..dcc51a86a8 100644 --- a/crates/ide-completion/src/render/pattern.rs +++ b/crates/ide-completion/src/render/pattern.rs @@ -1,17 +1,17 @@ //! Renderer for patterns. -use hir::{db::HirDatabase, Name, StructKind}; -use ide_db::{documentation::HasDocs, SnippetCap}; +use hir::{Name, StructKind, db::HirDatabase}; +use ide_db::{SnippetCap, documentation::HasDocs}; use itertools::Itertools; use syntax::{Edition, SmolStr, ToSmolStr}; use crate::{ + CompletionItem, CompletionItemKind, context::{ParamContext, ParamKind, PathCompletionCtx, PatternContext}, render::{ - variant::{format_literal_label, format_literal_lookup, visible_fields}, RenderContext, + variant::{format_literal_label, format_literal_lookup, visible_fields}, }, - CompletionItem, CompletionItemKind, }; pub(crate) fn render_struct_pat( @@ -64,11 +64,11 @@ pub(crate) fn render_variant_pat( ), None => { let name = local_name.unwrap_or_else(|| variant.name(ctx.db())); - let it = ( + + ( name.as_str().to_smolstr(), name.display(ctx.db(), ctx.completion.edition).to_smolstr(), - ); - it + ) } }; @@ -191,7 +191,7 @@ fn render_record_as_pat( format!( "{name} {{ {}{} }}", fields.enumerate().format_with(", ", |(idx, field), f| { - f(&format_args!("{}${}", field.name(db).display(db.upcast(), edition), idx + 1)) + f(&format_args!("{}${}", field.name(db).display(db, edition), idx + 1)) }), if fields_omitted { ", .." } else { "" }, name = name |