mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Cargo fmt
This commit is contained in:
parent
752c49b679
commit
f3a1b902fd
2 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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 ",
|
||||
|
|
Loading…
Reference in a new issue