2 ms·
As a big proponent of grepability, I think extension traits are still reasonable. You need to find out what the trait is that defines that method, but that ofte
by slaymaker1907 5y ago
As a big proponent of grepability, I think extension traits are still reasonable. You need to find out what the trait is that defines that method, but that often isn't too difficult. Once you know that, you just need to look at the module defining the struct and the module defining the trait.
Two things that can improve this are preferring Trait::method(obj) notation and importing traits explicitly rather than relying on crate preludes.
- eyelidlessness 5y agoAs someone who has only dabbled with Rust, this: > preferring Trait::method(obj) … vastly improved my understanding of trait usage.
- wffurr 5y agoHaving magic names show up in my code without an explicit import somewhere can be really frustrating, especially in unfamiliar code bases where I'm trying to contribute a small change. I think your suggestions do a good job addressing that; could be a thing for a style guide.