Migrate assists to format args captures, part 3

This commit is contained in:
DropDemBits 2022-10-10 14:20:27 -04:00
parent d23537394e
commit b1909a80af
18 changed files with 48 additions and 57 deletions

View file

@ -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}"))
}
};
},