Cargo fmt

This commit is contained in:
Yunfei 2024-07-29 16:51:49 +08:00
parent 752c49b679
commit f3a1b902fd
2 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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 ",