mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-15 02:09:36 +00:00
Migrate assists to format args captures, part 3
This commit is contained in:
parent
d23537394e
commit
b1909a80af
18 changed files with 48 additions and 57 deletions
|
|
@ -124,7 +124,7 @@ fn add_assist(
|
|||
) -> Option<()> {
|
||||
let target = attr.syntax().text_range();
|
||||
let annotated_name = adt.name()?;
|
||||
let label = format!("Convert to manual `impl {} for {}`", replace_trait_path, annotated_name);
|
||||
let label = format!("Convert to manual `impl {replace_trait_path} for {annotated_name}`");
|
||||
|
||||
acc.add(
|
||||
AssistId("replace_derive_with_manual_impl", AssistKind::Refactor),
|
||||
|
|
@ -158,11 +158,8 @@ fn add_assist(
|
|||
}
|
||||
}
|
||||
|
||||
builder.insert_snippet(
|
||||
cap,
|
||||
insert_pos,
|
||||
format!("\n\n{}", render_snippet(cap, impl_def.syntax(), cursor)),
|
||||
)
|
||||
let rendered = render_snippet(cap, impl_def.syntax(), cursor);
|
||||
builder.insert_snippet(cap, insert_pos, format!("\n\n{rendered}"))
|
||||
}
|
||||
};
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue