From f3a1b902fd71d8bd4c384d9752ffb73e13d760f2 Mon Sep 17 00:00:00 2001 From: Yunfei Date: Mon, 29 Jul 2024 16:51:49 +0800 Subject: [PATCH] Cargo fmt --- .../src/completions/item_list/trait_impl.rs | 10 +++++++--- .../src/handlers/trait_impl_missing_assoc_item.rs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ide-completion/src/completions/item_list/trait_impl.rs b/crates/ide-completion/src/completions/item_list/trait_impl.rs index 4a1f985b30..2fd7805e60 100644 --- a/crates/ide-completion/src/completions/item_list/trait_impl.rs +++ b/crates/ide-completion/src/completions/item_list/trait_impl.rs @@ -195,9 +195,13 @@ fn add_function_impl( }); let mut item = CompletionItem::new(completion_kind, replacement_range, label); - item.lookup_by(format!("{}fn {}", if is_async { "async "} else { "" },fn_name.display(ctx.db))) - .set_documentation(func.docs(ctx.db)) - .set_relevance(CompletionRelevance { is_item_from_trait: true, ..Default::default() }); + item.lookup_by(format!( + "{}fn {}", + if is_async { "async " } else { "" }, + fn_name.display(ctx.db) + )) + .set_documentation(func.docs(ctx.db)) + .set_relevance(CompletionRelevance { is_item_from_trait: true, ..Default::default() }); if let Some(source) = ctx.sema.source(func) { let assoc_item = ast::AssocItem::Fn(source.value); diff --git a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs index 836059cb9b..60d1452d86 100644 --- a/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs +++ b/crates/ide-diagnostics/src/handlers/trait_impl_missing_assoc_item.rs @@ -13,7 +13,7 @@ pub(crate) fn trait_impl_missing_assoc_item( ) -> Diagnostic { let missing = d.missing.iter().format_with(", ", |(name, item), f| { f(&match *item { - hir::AssocItem::Function(func) if func.is_async(ctx.sema.db) => "`async fn ", + hir::AssocItem::Function(func) if func.is_async(ctx.sema.db) => "`async fn ", hir::AssocItem::Function(_) => "`fn ", hir::AssocItem::Const(_) => "`const ", hir::AssocItem::TypeAlias(_) => "`type ",