zmwangx / rust-ffmpeg-sys

FFmpeg bindings for Rust.
113 stars 75 forks source link

Add feature to mark generated enums as non-exhaustive #48

Closed FreezyLemon closed 1 year ago

FreezyLemon commented 1 year ago

Closes #46.

This is a simple change. Enabling the feature adds the #[non_exhaustive] attribute to the generated enums (and nothing else). What this means for libraries/applications downstream is explained in the linked issue.

I'll explain why I think this should be a feature and not "always-on" in the corresponding PR against ffmpeg-next.

WcaleNieWolny commented 1 year ago

This PR is important. I currently cannot cross build my project using this lib due to the


633   |         match value {
      |               ^^^^^ patterns `AV_CODEC_ID_RADIANCE_HDR`, `AV_CODEC_ID_WBMP`, `AV_CODEC_ID_MEDIA100` and 5 more not covered
``` error. Please merge ASAP
Polochon-street commented 1 year ago

good idea to make it as a feature! Would it be possible to make it non-default for now though? And squash the two commits in one?

Polochon-street commented 1 year ago

:+1: thanks! Greatly appreciated, we've been needing that for a long time