3 ms·
Deref polymorphism is a known anti pattern. https://rust-unofficial.github.io/patterns/anti_patterns/deref.html https://rust-unofficial.github.io/patterns/anti
by rascul 3y ago
Deref polymorphism is a known anti pattern.
https://rust-unofficial.github.io/patterns/anti_patterns/deref.html https://rust-unofficial.github.io/patterns/anti_patterns/der...
- an_ko 3y agoYep. The docs for Deref also dedicate a whole paragraph, with a conclusion in bold, near the start of the page, to why it's a bad idea. https://doc.rust-lang.org/std/ops/trait.Deref.html https://doc.rust-lang.org/std/ops/trait.Deref.html
- adamc 3y agoCouldn't one equally see that as a footgun, given the lack of great solutions for something like this example?