Open
Description
Add a Code Action, Generate blanket trait implementation
on trait define
- Generate
This
generic param - Generate
Self
bounds toThis
- Generate where-clause bounds
- Generate required methods, use
todo!()
fill
trait Foo: ToOwned
where
Self::Owned: Default,
{
fn foo(&self) -> i32;
fn print_foo(&self) {
println!("{}", self.foo());
}
}
On trait Foo
use Generate blanket trait implementation
:
trait Foo: ToOwned
where
Self::Owned: Default,
{
fn foo(&self) -> i32;
fn print_foo(&self) {
println!("{}", self.foo());
}
}
impl<This: ToOwned> Foo for This
where
This::Owned: Default,
{
fn foo(&self) -> i32 {
todo!()
}
}