Hacker News new | ask | show | jobs
by Brentward 1506 days 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.
1 comments

Yeah, 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