impl Foo {
fn utility_shortcut(&self) {
self.core_functionality();
}
}
This makes the method available only on Foo trait objects, and that requires you to coerce to one in f2.
I can see a couple of approaches:
- Make utility_shortcut a free function that takes a &Foo trait object.
- Create a separate trait, let’s call it FooExt, that contains the util method. Then impl it for Foo and for
F: Foo