vscode-rust
vscode-rust copied to clipboard
Propose to box parameter if it's a struct
When a user hovers the cursor over a method parameter, a yellow light bulb should appear that lets wrap it into a box.
From:
struct Foo {
bar: &Bar,
}
struct Bar;
impl Foo {
fn new(bar: &Bar) -> Self {
Foo { bar }
}
}
Into:
struct Foo {
bar: &Box<Bar>,
}
struct Bar;
impl Foo {
fn new(bar: &Box<Bar>) -> Self {
Foo { bar }
}
}