5 ms·
Can't you just provide a default implementation of the method on the trait itself? Unless there are more requirements I'm not parsing from what you wrote, that
by Brentward 4y ago
Can't you just provide a default implementation of the method on the trait itself? Unless there are more requirements I'm not parsing from what you wrote, that seems to do exactly what they wanted.
- saghm 4y agoYeah, I'm not sure I fully understand as well. The only thing I can think of is that the trait was supposed to be from outside the crate (i.e. not modifyable), but then then, I'm not sure why writing a function that was generic over T: ThatTrait that took an instance as a parameter (or even `impl ThatTrait`) wouldn't work