From 28c356dd984a22b9e857ba9c02871ff2e364f6a6 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 22 Oct 2022 16:25:24 +0200 Subject: [PATCH] add wildcard branches for matches on enums --- src/codec/audio_service.rs | 2 ++ src/codec/discard.rs | 2 ++ src/codec/field_order.rs | 2 ++ src/codec/id.rs | 2 ++ src/codec/packet/side_data.rs | 2 ++ src/codec/subtitle/mod.rs | 2 ++ src/software/resampling/dither.rs | 2 ++ src/software/resampling/engine.rs | 2 ++ src/software/resampling/filter.rs | 2 ++ src/util/chroma/location.rs | 2 ++ src/util/color/primaries.rs | 2 ++ src/util/color/range.rs | 2 ++ src/util/color/space.rs | 2 ++ src/util/color/transfer_characteristic.rs | 2 ++ src/util/format/pixel.rs | 2 ++ src/util/format/sample.rs | 2 ++ src/util/frame/side_data.rs | 2 ++ src/util/mathematics/rounding.rs | 2 ++ src/util/media.rs | 2 ++ src/util/option/mod.rs | 2 ++ src/util/picture.rs | 2 ++ 21 files changed, 42 insertions(+) diff --git a/src/codec/audio_service.rs b/src/codec/audio_service.rs index 37486ce..008b801 100644 --- a/src/codec/audio_service.rs +++ b/src/codec/audio_service.rs @@ -27,6 +27,8 @@ impl From for AudioService { AV_AUDIO_SERVICE_TYPE_VOICE_OVER => AudioService::VoiceOver, AV_AUDIO_SERVICE_TYPE_KARAOKE => AudioService::Karaoke, AV_AUDIO_SERVICE_TYPE_NB => AudioService::Main, + + _ => unimplemented!(), } } } diff --git a/src/codec/discard.rs b/src/codec/discard.rs index 156712c..72e64d3 100644 --- a/src/codec/discard.rs +++ b/src/codec/discard.rs @@ -22,6 +22,8 @@ impl From for Discard { AVDISCARD_NONINTRA => Discard::NonIntra, AVDISCARD_NONKEY => Discard::NonKey, AVDISCARD_ALL => Discard::All, + + _ => unimplemented!(), } } } diff --git a/src/codec/field_order.rs b/src/codec/field_order.rs index 67a5b7e..abc2d57 100644 --- a/src/codec/field_order.rs +++ b/src/codec/field_order.rs @@ -20,6 +20,8 @@ impl From for FieldOrder { AV_FIELD_BB => FieldOrder::BB, AV_FIELD_TB => FieldOrder::TB, AV_FIELD_BT => FieldOrder::BT, + + _ => unimplemented!(), } } } diff --git a/src/codec/id.rs b/src/codec/id.rs index 8999353..c5c787c 100644 --- a/src/codec/id.rs +++ b/src/codec/id.rs @@ -1233,6 +1233,8 @@ impl From for Id { AV_CODEC_ID_PHM => Id::PHM, #[cfg(feature = "ffmpeg_5_1")] AV_CODEC_ID_DFPWM => Id::DFPWM, + + _ => unimplemented!(), } } } diff --git a/src/codec/packet/side_data.rs b/src/codec/packet/side_data.rs index 13234d3..78740c4 100644 --- a/src/codec/packet/side_data.rs +++ b/src/codec/packet/side_data.rs @@ -106,6 +106,8 @@ impl From for Type { #[cfg(feature = "ffmpeg_5_0")] AV_PKT_DATA_DYNAMIC_HDR10_PLUS => Type::DYNAMIC_HDR10_PLUS, + + _ => unimplemented!(), } } } diff --git a/src/codec/subtitle/mod.rs b/src/codec/subtitle/mod.rs index f59da2d..e3f694d 100644 --- a/src/codec/subtitle/mod.rs +++ b/src/codec/subtitle/mod.rs @@ -29,6 +29,8 @@ impl From for Type { SUBTITLE_BITMAP => Type::Bitmap, SUBTITLE_TEXT => Type::Text, SUBTITLE_ASS => Type::Ass, + + _ => unimplemented!(), } } } diff --git a/src/software/resampling/dither.rs b/src/software/resampling/dither.rs index fc99105..c9c6ee4 100644 --- a/src/software/resampling/dither.rs +++ b/src/software/resampling/dither.rs @@ -34,6 +34,8 @@ impl From for Dither { SWR_DITHER_NS_LOW_SHIBATA => Dither::NoiseShapingLowShibata, SWR_DITHER_NS_HIGH_SHIBATA => Dither::NoiseShapingHighShibata, SWR_DITHER_NB => Dither::None, + + _ => unimplemented!(), } } } diff --git a/src/software/resampling/engine.rs b/src/software/resampling/engine.rs index cc2681a..335eca4 100644 --- a/src/software/resampling/engine.rs +++ b/src/software/resampling/engine.rs @@ -13,6 +13,8 @@ impl From for Engine { SWR_ENGINE_SWR => Engine::Software, SWR_ENGINE_SOXR => Engine::SoundExchange, SWR_ENGINE_NB => Engine::Software, + + _ => unimplemented!(), } } } diff --git a/src/software/resampling/filter.rs b/src/software/resampling/filter.rs index 3d5b9cc..7bf2aa5 100644 --- a/src/software/resampling/filter.rs +++ b/src/software/resampling/filter.rs @@ -14,6 +14,8 @@ impl From for Filter { SWR_FILTER_TYPE_CUBIC => Filter::Cubic, SWR_FILTER_TYPE_BLACKMAN_NUTTALL => Filter::BlackmanNuttall, SWR_FILTER_TYPE_KAISER => Filter::Kaiser, + + _ => unimplemented!(), } } } diff --git a/src/util/chroma/location.rs b/src/util/chroma/location.rs index 28f15bb..f4e56e3 100644 --- a/src/util/chroma/location.rs +++ b/src/util/chroma/location.rs @@ -23,6 +23,8 @@ impl From for Location { AVCHROMA_LOC_BOTTOMLEFT => Location::BottomLeft, AVCHROMA_LOC_BOTTOM => Location::Bottom, AVCHROMA_LOC_NB => Location::Unspecified, + + _ => unimplemented!(), } } } diff --git a/src/util/color/primaries.rs b/src/util/color/primaries.rs index 0ae557f..91ccfe3 100644 --- a/src/util/color/primaries.rs +++ b/src/util/color/primaries.rs @@ -66,6 +66,8 @@ impl From for Primaries { AVCOL_PRI_JEDEC_P22 => Primaries::JEDEC_P22, #[cfg(feature = "ffmpeg_4_3")] AVCOL_PRI_EBU3213 => Primaries::EBU3213, + + _ => unimplemented!(), } } } diff --git a/src/util/color/range.rs b/src/util/color/range.rs index e1ad395..e527d08 100644 --- a/src/util/color/range.rs +++ b/src/util/color/range.rs @@ -31,6 +31,8 @@ impl From for Range { AVCOL_RANGE_MPEG => Range::MPEG, AVCOL_RANGE_JPEG => Range::JPEG, AVCOL_RANGE_NB => Range::Unspecified, + + _ => unimplemented!(), } } } diff --git a/src/util/color/space.rs b/src/util/color/space.rs index 82dde41..247f7b3 100644 --- a/src/util/color/space.rs +++ b/src/util/color/space.rs @@ -59,6 +59,8 @@ impl From for Space { AVCOL_SPC_CHROMA_DERIVED_NCL => Space::ChromaDerivedNCL, AVCOL_SPC_CHROMA_DERIVED_CL => Space::ChromaDerivedCL, AVCOL_SPC_ICTCP => Space::ICTCP, + + _ => unimplemented!(), } } } diff --git a/src/util/color/transfer_characteristic.rs b/src/util/color/transfer_characteristic.rs index e35aad0..6992534 100644 --- a/src/util/color/transfer_characteristic.rs +++ b/src/util/color/transfer_characteristic.rs @@ -63,6 +63,8 @@ impl From for TransferCharacteristic { AVCOL_TRC_SMPTE2084 => TransferCharacteristic::SMPTE2084, AVCOL_TRC_SMPTE428 => TransferCharacteristic::SMPTE428, AVCOL_TRC_ARIB_STD_B67 => TransferCharacteristic::ARIB_STD_B67, + + _ => unimplemented!(), } } } diff --git a/src/util/format/pixel.rs b/src/util/format/pixel.rs index e582f74..3387172 100644 --- a/src/util/format/pixel.rs +++ b/src/util/format/pixel.rs @@ -742,6 +742,8 @@ impl From for Pixel { AV_PIX_FMT_RPI4_8 => Pixel::RPI4_8, #[cfg(feature = "rpi")] AV_PIX_FMT_RPI4_10 => Pixel::RPI4_10, + + _ => unimplemented!(), } } } diff --git a/src/util/format/sample.rs b/src/util/format/sample.rs index 7f1b14d..724120d 100644 --- a/src/util/format/sample.rs +++ b/src/util/format/sample.rs @@ -86,6 +86,8 @@ impl From for Sample { AV_SAMPLE_FMT_DBLP => Sample::F64(Type::Planar), AV_SAMPLE_FMT_NB => Sample::None, + + _ => unimplemented!(), } } } diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index ae375a0..f88d9c1 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -120,6 +120,8 @@ impl From for Type { #[cfg(feature = "ffmpeg_5_1")] AV_FRAME_DATA_DYNAMIC_HDR_VIVID => Type::DYNAMIC_HDR_VIVID, + + _ => unimplemented!(), } } } diff --git a/src/util/mathematics/rounding.rs b/src/util/mathematics/rounding.rs index b3d279d..6ac8145 100644 --- a/src/util/mathematics/rounding.rs +++ b/src/util/mathematics/rounding.rs @@ -21,6 +21,8 @@ impl From for Rounding { AV_ROUND_UP => Rounding::Up, AV_ROUND_NEAR_INF => Rounding::NearInfinity, AV_ROUND_PASS_MINMAX => Rounding::PassMinMax, + + _ => unimplemented!(), } } } diff --git a/src/util/media.rs b/src/util/media.rs index 531f624..6c6d243 100644 --- a/src/util/media.rs +++ b/src/util/media.rs @@ -22,6 +22,8 @@ impl From for Type { AVMEDIA_TYPE_SUBTITLE => Type::Subtitle, AVMEDIA_TYPE_ATTACHMENT => Type::Attachment, AVMEDIA_TYPE_NB => Type::Unknown, + + _ => unimplemented!(), } } } diff --git a/src/util/option/mod.rs b/src/util/option/mod.rs index e340d98..406dfcd 100644 --- a/src/util/option/mod.rs +++ b/src/util/option/mod.rs @@ -53,6 +53,8 @@ impl From for Type { AV_OPT_TYPE_CHANNEL_LAYOUT => Type::ChannelLayout, #[cfg(feature = "ffmpeg_5_1")] AV_OPT_TYPE_CHLAYOUT => Type::ChannelLayout, + + _ => unimplemented!(), } } } diff --git a/src/util/picture.rs b/src/util/picture.rs index c89a918..916af04 100644 --- a/src/util/picture.rs +++ b/src/util/picture.rs @@ -25,6 +25,8 @@ impl From for Type { AV_PICTURE_TYPE_SI => Type::SI, AV_PICTURE_TYPE_SP => Type::SP, AV_PICTURE_TYPE_BI => Type::BI, + + _ => unimplemented!(), } } }