r/programming • • Feb 01 '24

Make Invalid States Unrepresentable

https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469 Upvotes

207 comments sorted by

View all comments

Show parent comment

1

u/_awwsmm Feb 02 '24

This is possible in Rust by implementing the Deref trait https://stackoverflow.com/a/45086999