From e9adbaae6275e81703d6b6c5e677e897a3d75841 Mon Sep 17 00:00:00 2001 From: Erin Moon Date: Mon, 11 Jun 2018 14:21:34 -0500 Subject: [PATCH] compile From<_> impls for -std enums even if they're not total --- src/codec/id.rs | 2 ++ src/codec/packet/side_data.rs | 2 ++ src/util/color/space.rs | 3 +++ src/util/format/pixel.rs | 2 ++ src/util/frame/side_data.rs | 2 ++ 5 files changed, 11 insertions(+) diff --git a/src/codec/id.rs b/src/codec/id.rs index 28e923b9..ee1c0468 100644 --- a/src/codec/id.rs +++ b/src/codec/id.rs @@ -965,6 +965,8 @@ impl From for Id { AV_CODEC_ID_FITS => Id::FITS, AV_CODEC_ID_GREMLIN_DPCM => Id::GREMLIN_DPCM, AV_CODEC_ID_DOLBY_E => Id::DOLBY_E, + + _ => unimplemented!(), } } } diff --git a/src/codec/packet/side_data.rs b/src/codec/packet/side_data.rs index 6dd5cb58..340d3640 100644 --- a/src/codec/packet/side_data.rs +++ b/src/codec/packet/side_data.rs @@ -64,6 +64,8 @@ impl From for Type { AV_PKT_DATA_CONTENT_LIGHT_LEVEL => Type::ContentLightLevel, AV_PKT_DATA_A53_CC => Type::A53CC, + + _ => unimplemented!(), } } } diff --git a/src/util/color/space.rs b/src/util/color/space.rs index 33f80b35..d49c8dc4 100644 --- a/src/util/color/space.rs +++ b/src/util/color/space.rs @@ -35,6 +35,7 @@ impl Space { impl From for Space { fn from(value: AVColorSpace) -> Self { + #[allow(unreachable_patterns)] match value { AVCOL_SPC_RGB => Space::RGB, AVCOL_SPC_BT709 => Space::BT709, @@ -53,6 +54,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/format/pixel.rs b/src/util/format/pixel.rs index c415f36a..0ed27976 100644 --- a/src/util/format/pixel.rs +++ b/src/util/format/pixel.rs @@ -589,6 +589,8 @@ impl From for Pixel { AV_PIX_FMT_GBRAPF32BE => Pixel::GBRAPF32BE, AV_PIX_FMT_GBRAPF32LE => Pixel::GBRAPF32LE, AV_PIX_FMT_DRM_PRIME => Pixel::DRM_PRIME, + + _ => unimplemented!(), } } } diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index acc5024e..a8e1dc40 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -59,6 +59,8 @@ impl From for Type { AV_FRAME_DATA_CONTENT_LIGHT_LEVEL => Type::ContentLightLevel, AV_FRAME_DATA_ICC_PROFILE => Type::IccProfile, + + _ => unimplemented!(), } } }