rust-mobile / ndk

Rust bindings to the Android NDK
Apache License 2.0
1.11k stars 110 forks source link

ndk/media_error: Flatten `MediaStatus` and `MediaError` with `catch_all` #432

Closed MarijnS95 closed 11 months ago

MarijnS95 commented 11 months ago

~Depends on #431~

Since bumping our MSRV to 1.66 num_enum provides a catch_all variant which we can use to store yet-unknown or yet-unmapped error codes, rather than having them in a secondary enum which derives thiserror.

This also allows us to get rid of a manual match statement, which can be (but could already have been...) generated by num_enum via TryFromPrimitive before.