Prevent Breaking Code Changes in Future Releases using `non exhaustive` enums in Rust
Reading Time: 2 minutes Hello everyone, recently I have come across a feature in Rust, known as non_exhaustive. It was introduced in Rust 1.40.0 . This attribute prevents source code-breaking changes in projects downstream. enums can be non-exhaustive or exhaustive, depending upon their needs. A non-exhaustive enum indicates that this enum may get new value in the future. By adding #[non_exhaustive] attribute, we can create a non-exhaustive enum which Continue Reading