Hacker News new | ask | show | jobs
by ______-_-______ 1525 days ago
I hope the tide does turn and then keeps going. I think the language restrictions around Deref(Mut) and Index(Mut) originally borne of purism are just not all that helpful in practice. I can make a network request in my Deref impl, but I can't return a smart pointer?
1 comments

The danger with DerefMut is that one may accidentally allow violating the type's invariant. Same with Deref when interior mutability is present.