You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often, there are enums in the ffmpeg crate that have From<AVEnum> for Enum implementations (and vice versa). These will automatically show missing variants due to non-exhaustive match statements whenever a new FFmpeg version is released.
However, there are some enums where this doesn't work. Those could (and should) have a test, hidden behind a feature flag, to check whether the match statement on the AVEnum is exhaustive. Rough draft:
#[cfg(all(test, feature = "check-enums"))]mod dev_test {fnexhaustive_av_option_type(x:AVOptionType){match x {// all variants}}}
(AVOptionType is a random example, it currently has an exhaustive match statement in its API). I think bitflags structs mostly benefit from this.
If someone starts adding these, they might aswell add these for all known enums while they're at it (and offload them to a separate test-only file). That would make it easy to just run cargo check -F check-enum or something whenever preparing for a new FFmpeg version.
The text was updated successfully, but these errors were encountered:
Often, there are enums in the
ffmpeg
crate that haveFrom<AVEnum> for Enum
implementations (and vice versa). These will automatically show missing variants due to non-exhaustive match statements whenever a new FFmpeg version is released.However, there are some enums where this doesn't work. Those could (and should) have a test, hidden behind a feature flag, to check whether the match statement on the
AVEnum
is exhaustive. Rough draft:(
AVOptionType
is a random example, it currently has an exhaustive match statement in its API). I thinkbitflags
structs mostly benefit from this.If someone starts adding these, they might aswell add these for all known enums while they're at it (and offload them to a separate test-only file). That would make it easy to just run
cargo check -F check-enum
or something whenever preparing for a new FFmpeg version.The text was updated successfully, but these errors were encountered: