17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
909 stars 63 forks source link

Make enums non_exhaustive if they are likely to be extended #276

Closed 17cupsofcoffee closed 2 years ago

17cupsofcoffee commented 3 years ago

Summary

Enums like Key are likely to be extended at some point in the future - this would currently technically be a breaking change, as if someone happens to be matching on every variant (e.g. for a conversion method?) then their code would no longer compile.

In 0.7, I should do an audit of all the enums in the crate and add #[non_exhaustive] where appropriate to prevent this from being a problem going forward.

Motivation/Examples

No response

Alternatives Considered

No response

17cupsofcoffee commented 2 years ago

Done on 0.7 branch.