Just found some Rust code from a couple of years ago where I used Deref and DerefMut to essentially simulate inheritance...oops 
-
-
Replying to @Sunjay03
Honestly I'm not sure why folks consider that an anti pattern. "deref is only for smart pointers" but then we have String and Vec which aren't smart pointers but everyone is fine with it there
2 replies 0 retweets 5 likes -
It fails the Liskov substitution principle: Deref cocercion means the “subclass” inherits/impls none of the traits of the parent “class”. But it can work in a pinch
1 reply 0 retweets 3 likes
Are we judging things on abstract principles of questionable value?
9:05 PM - 1 Dec 2019
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.