From 19ab5f67ad5bd0f67d075d26681377a924ae01e6 Mon Sep 17 00:00:00 2001 From: Polochon-street Date: Tue, 6 Jul 2021 19:05:15 +0200 Subject: [PATCH] Fix linting errors --- .github/workflows/build.yml | 3 ++- src/codec/audio_service.rs | 6 +++--- src/codec/compliance.rs | 6 +++--- src/codec/discard.rs | 6 +++--- src/codec/encoder/comparison.rs | 6 +++--- src/codec/encoder/decision.rs | 6 +++--- src/codec/encoder/motion_estimation.rs | 6 +++--- src/codec/encoder/prediction.rs | 6 +++--- src/codec/field_order.rs | 6 +++--- src/codec/id.rs | 12 ++++++------ src/codec/packet/side_data.rs | 12 ++++++------ src/codec/profile.rs | 6 +++--- src/codec/subtitle/mod.rs | 6 +++--- src/codec/threading.rs | 6 +++--- src/software/resampling/dither.rs | 6 +++--- src/software/resampling/engine.rs | 6 +++--- src/software/resampling/filter.rs | 6 +++--- src/software/scaling/color_space.rs | 6 +++--- src/util/chroma/location.rs | 6 +++--- src/util/color/primaries.rs | 6 +++--- src/util/color/range.rs | 6 +++--- src/util/color/space.rs | 6 +++--- src/util/color/transfer_characteristic.rs | 6 +++--- src/util/error.rs | 8 ++++---- src/util/format/pixel.rs | 6 +++--- src/util/format/sample.rs | 6 +++--- src/util/frame/side_data.rs | 12 ++++++------ src/util/log/level.rs | 6 +++--- src/util/mathematics/rounding.rs | 6 +++--- src/util/media.rs | 6 +++--- src/util/option/mod.rs | 6 +++--- src/util/picture.rs | 6 +++--- src/util/rational.rs | 8 ++++---- 33 files changed, 109 insertions(+), 108 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db098a4..a4f9649 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu strategy: matrix: - ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3"] + ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4"] fail-fast: false steps: - uses: actions/checkout@v2 @@ -87,6 +87,7 @@ jobs: mkdir ffmpeg mv ffmpeg-*/* ffmpeg/ Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n" + Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n" - name: Set up Rust uses: actions-rs/toolchain@v1 with: diff --git a/src/codec/audio_service.rs b/src/codec/audio_service.rs index e1ca3eb..37486ce 100644 --- a/src/codec/audio_service.rs +++ b/src/codec/audio_service.rs @@ -31,9 +31,9 @@ impl From for AudioService { } } -impl Into for AudioService { - fn into(self) -> AVAudioServiceType { - match self { +impl From for AVAudioServiceType { + fn from(value: AudioService) -> AVAudioServiceType { + match value { AudioService::Main => AV_AUDIO_SERVICE_TYPE_MAIN, AudioService::Effects => AV_AUDIO_SERVICE_TYPE_EFFECTS, AudioService::VisuallyImpaired => AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED, diff --git a/src/codec/compliance.rs b/src/codec/compliance.rs index e6f1ec3..a305ffe 100644 --- a/src/codec/compliance.rs +++ b/src/codec/compliance.rs @@ -24,9 +24,9 @@ impl From for Compliance { } } -impl Into for Compliance { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Compliance) -> c_int { + match value { Compliance::VeryStrict => FF_COMPLIANCE_VERY_STRICT, Compliance::Strict => FF_COMPLIANCE_STRICT, Compliance::Normal => FF_COMPLIANCE_NORMAL, diff --git a/src/codec/discard.rs b/src/codec/discard.rs index 4fb97fa..156712c 100644 --- a/src/codec/discard.rs +++ b/src/codec/discard.rs @@ -26,9 +26,9 @@ impl From for Discard { } } -impl Into for Discard { - fn into(self) -> AVDiscard { - match self { +impl From for AVDiscard { + fn from(value: Discard) -> AVDiscard { + match value { Discard::None => AVDISCARD_NONE, Discard::Default => AVDISCARD_DEFAULT, Discard::NonReference => AVDISCARD_NONREF, diff --git a/src/codec/encoder/comparison.rs b/src/codec/encoder/comparison.rs index 503fd06..1bd573b 100644 --- a/src/codec/encoder/comparison.rs +++ b/src/codec/encoder/comparison.rs @@ -46,9 +46,9 @@ impl From for Comparison { } } -impl Into for Comparison { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Comparison) -> c_int { + match value { Comparison::SAD => FF_CMP_SAD, Comparison::SSE => FF_CMP_SSE, Comparison::SATD => FF_CMP_SATD, diff --git a/src/codec/encoder/decision.rs b/src/codec/encoder/decision.rs index cb8c903..93c5aba 100644 --- a/src/codec/encoder/decision.rs +++ b/src/codec/encoder/decision.rs @@ -20,9 +20,9 @@ impl From for Decision { } } -impl Into for Decision { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Decision) -> c_int { + match value { Decision::Simple => FF_MB_DECISION_SIMPLE, Decision::Bits => FF_MB_DECISION_BITS, Decision::RateDistortion => FF_MB_DECISION_RD, diff --git a/src/codec/encoder/motion_estimation.rs b/src/codec/encoder/motion_estimation.rs index 6cd67b3..0202d35 100644 --- a/src/codec/encoder/motion_estimation.rs +++ b/src/codec/encoder/motion_estimation.rs @@ -33,9 +33,9 @@ impl From for MotionEstimation { } } -impl Into for MotionEstimation { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: MotionEstimation) -> c_int { + match value { MotionEstimation::Zero => 1, MotionEstimation::Full => 2, MotionEstimation::Log => 3, diff --git a/src/codec/encoder/prediction.rs b/src/codec/encoder/prediction.rs index 3b22777..ba532f3 100644 --- a/src/codec/encoder/prediction.rs +++ b/src/codec/encoder/prediction.rs @@ -20,9 +20,9 @@ impl From for Prediction { } } -impl Into for Prediction { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Prediction) -> c_int { + match value { Prediction::Left => FF_PRED_LEFT, Prediction::Plane => FF_PRED_PLANE, Prediction::Median => FF_PRED_MEDIAN, diff --git a/src/codec/field_order.rs b/src/codec/field_order.rs index 46dff81..67a5b7e 100644 --- a/src/codec/field_order.rs +++ b/src/codec/field_order.rs @@ -24,9 +24,9 @@ impl From for FieldOrder { } } -impl Into for FieldOrder { - fn into(self) -> AVFieldOrder { - match self { +impl From for AVFieldOrder { + fn from(value: FieldOrder) -> AVFieldOrder { + match value { FieldOrder::Unknown => AV_FIELD_UNKNOWN, FieldOrder::Progressive => AV_FIELD_PROGRESSIVE, FieldOrder::TT => AV_FIELD_TT, diff --git a/src/codec/id.rs b/src/codec/id.rs index 85e088c..f666b7f 100644 --- a/src/codec/id.rs +++ b/src/codec/id.rs @@ -594,7 +594,7 @@ pub enum Id { #[cfg(feature = "ffmpeg_4_4")] ADPCM_IMA_MOFLEX, #[cfg(feature = "ffmpeg_4_4")] - FASTAUDIO + FASTAUDIO, } impl Id { @@ -1196,14 +1196,14 @@ impl From for Id { #[cfg(feature = "ffmpeg_4_4")] AV_CODEC_ID_ADPCM_IMA_MOFLEX => Id::ADPCM_IMA_MOFLEX, #[cfg(feature = "ffmpeg_4_4")] - AV_CODEC_ID_FASTAUDIO => Id::FASTAUDIO + AV_CODEC_ID_FASTAUDIO => Id::FASTAUDIO, } } } -impl Into for Id { - fn into(self) -> AVCodecID { - match self { +impl From for AVCodecID { + fn from(value: Id) -> AVCodecID { + match value { Id::None => AV_CODEC_ID_NONE, /* video codecs */ @@ -1790,7 +1790,7 @@ impl Into for Id { #[cfg(feature = "ffmpeg_4_4")] Id::ADPCM_IMA_MOFLEX => AV_CODEC_ID_ADPCM_IMA_MOFLEX, #[cfg(feature = "ffmpeg_4_4")] - Id::FASTAUDIO => AV_CODEC_ID_FASTAUDIO + Id::FASTAUDIO => AV_CODEC_ID_FASTAUDIO, } } } diff --git a/src/codec/packet/side_data.rs b/src/codec/packet/side_data.rs index 5e29995..59de0bf 100644 --- a/src/codec/packet/side_data.rs +++ b/src/codec/packet/side_data.rs @@ -50,7 +50,7 @@ pub enum Type { DOVI_CONF, #[cfg(feature = "ffmpeg_4_4")] - S12M_TIMECODE + S12M_TIMECODE, } impl From for Type { @@ -99,14 +99,14 @@ impl From for Type { AV_PKT_DATA_DOVI_CONF => Type::DOVI_CONF, #[cfg(feature = "ffmpeg_4_4")] - AV_PKT_DATA_S12M_TIMECODE => Type::S12M_TIMECODE + AV_PKT_DATA_S12M_TIMECODE => Type::S12M_TIMECODE, } } } -impl Into for Type { - fn into(self) -> AVPacketSideDataType { - match self { +impl From for AVPacketSideDataType { + fn from(value: Type) -> AVPacketSideDataType { + match value { Type::Palette => AV_PKT_DATA_PALETTE, Type::NewExtraData => AV_PKT_DATA_NEW_EXTRADATA, Type::ParamChange => AV_PKT_DATA_PARAM_CHANGE, @@ -150,7 +150,7 @@ impl Into for Type { Type::DOVI_CONF => AV_PKT_DATA_DOVI_CONF, #[cfg(feature = "ffmpeg_4_4")] - Type::S12M_TIMECODE => AV_PKT_DATA_S12M_TIMECODE + Type::S12M_TIMECODE => AV_PKT_DATA_S12M_TIMECODE, } } } diff --git a/src/codec/profile.rs b/src/codec/profile.rs index c76b86c..f9dbd72 100644 --- a/src/codec/profile.rs +++ b/src/codec/profile.rs @@ -279,9 +279,9 @@ impl From<(Id, c_int)> for Profile { } } -impl Into for Profile { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Profile) -> c_int { + match value { Profile::Unknown => FF_PROFILE_UNKNOWN, Profile::Reserved => FF_PROFILE_RESERVED, diff --git a/src/codec/subtitle/mod.rs b/src/codec/subtitle/mod.rs index afc248d..f59da2d 100644 --- a/src/codec/subtitle/mod.rs +++ b/src/codec/subtitle/mod.rs @@ -33,9 +33,9 @@ impl From for Type { } } -impl Into for Type { - fn into(self) -> AVSubtitleType { - match self { +impl From for AVSubtitleType { + fn from(value: Type) -> AVSubtitleType { + match value { Type::None => SUBTITLE_NONE, Type::Bitmap => SUBTITLE_BITMAP, Type::Text => SUBTITLE_TEXT, diff --git a/src/codec/threading.rs b/src/codec/threading.rs index 4c3069d..1cc95ee 100644 --- a/src/codec/threading.rs +++ b/src/codec/threading.rs @@ -59,9 +59,9 @@ impl From for Type { } } -impl Into for Type { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Type) -> c_int { + match value { Type::None => 0, Type::Frame => FF_THREAD_FRAME, Type::Slice => FF_THREAD_SLICE, diff --git a/src/software/resampling/dither.rs b/src/software/resampling/dither.rs index 728d34a..fc99105 100644 --- a/src/software/resampling/dither.rs +++ b/src/software/resampling/dither.rs @@ -38,9 +38,9 @@ impl From for Dither { } } -impl Into for Dither { - fn into(self) -> SwrDitherType { - match self { +impl From for SwrDitherType { + fn from(value: Dither) -> SwrDitherType { + match value { Dither::None => SWR_DITHER_NONE, Dither::Rectangular => SWR_DITHER_RECTANGULAR, Dither::Triangular => SWR_DITHER_TRIANGULAR, diff --git a/src/software/resampling/engine.rs b/src/software/resampling/engine.rs index 65acc92..cc2681a 100644 --- a/src/software/resampling/engine.rs +++ b/src/software/resampling/engine.rs @@ -17,9 +17,9 @@ impl From for Engine { } } -impl Into for Engine { - fn into(self) -> SwrEngine { - match self { +impl From for SwrEngine { + fn from(value: Engine) -> SwrEngine { + match value { Engine::Software => SWR_ENGINE_SWR, Engine::SoundExchange => SWR_ENGINE_SOXR, } diff --git a/src/software/resampling/filter.rs b/src/software/resampling/filter.rs index 0b2b268..3d5b9cc 100644 --- a/src/software/resampling/filter.rs +++ b/src/software/resampling/filter.rs @@ -18,9 +18,9 @@ impl From for Filter { } } -impl Into for Filter { - fn into(self) -> SwrFilterType { - match self { +impl From for SwrFilterType { + fn from(value: Filter) -> SwrFilterType { + match value { Filter::Cubic => SWR_FILTER_TYPE_CUBIC, Filter::BlackmanNuttall => SWR_FILTER_TYPE_BLACKMAN_NUTTALL, Filter::Kaiser => SWR_FILTER_TYPE_KAISER, diff --git a/src/software/scaling/color_space.rs b/src/software/scaling/color_space.rs index bd34a10..0c74148 100644 --- a/src/software/scaling/color_space.rs +++ b/src/software/scaling/color_space.rs @@ -26,9 +26,9 @@ impl From for ColorSpace { } } -impl Into for ColorSpace { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: ColorSpace) -> c_int { + match value { ColorSpace::Default => SWS_CS_DEFAULT, ColorSpace::ITU709 => SWS_CS_ITU709, ColorSpace::FCC => SWS_CS_FCC, diff --git a/src/util/chroma/location.rs b/src/util/chroma/location.rs index 0c5e3e8..28f15bb 100644 --- a/src/util/chroma/location.rs +++ b/src/util/chroma/location.rs @@ -27,9 +27,9 @@ impl From for Location { } } -impl Into for Location { - fn into(self) -> AVChromaLocation { - match self { +impl From for AVChromaLocation { + fn from(value: Location) -> AVChromaLocation { + match value { Location::Unspecified => AVCHROMA_LOC_UNSPECIFIED, Location::Left => AVCHROMA_LOC_LEFT, Location::Center => AVCHROMA_LOC_CENTER, diff --git a/src/util/color/primaries.rs b/src/util/color/primaries.rs index fd8968c..0ae557f 100644 --- a/src/util/color/primaries.rs +++ b/src/util/color/primaries.rs @@ -70,9 +70,9 @@ impl From for Primaries { } } -impl Into for Primaries { - fn into(self) -> AVColorPrimaries { - match self { +impl From for AVColorPrimaries { + fn from(value: Primaries) -> AVColorPrimaries { + match value { Primaries::Reserved0 => AVCOL_PRI_RESERVED0, Primaries::BT709 => AVCOL_PRI_BT709, Primaries::Unspecified => AVCOL_PRI_UNSPECIFIED, diff --git a/src/util/color/range.rs b/src/util/color/range.rs index 4fb267c..e1ad395 100644 --- a/src/util/color/range.rs +++ b/src/util/color/range.rs @@ -35,9 +35,9 @@ impl From for Range { } } -impl Into for Range { - fn into(self) -> AVColorRange { - match self { +impl From for AVColorRange { + fn from(value: Range) -> AVColorRange { + match value { Range::Unspecified => AVCOL_RANGE_UNSPECIFIED, Range::MPEG => AVCOL_RANGE_MPEG, Range::JPEG => AVCOL_RANGE_JPEG, diff --git a/src/util/color/space.rs b/src/util/color/space.rs index eba43c1..82dde41 100644 --- a/src/util/color/space.rs +++ b/src/util/color/space.rs @@ -63,9 +63,9 @@ impl From for Space { } } -impl Into for Space { - fn into(self) -> AVColorSpace { - match self { +impl From for AVColorSpace { + fn from(value: Space) -> AVColorSpace { + match value { Space::RGB => AVCOL_SPC_RGB, Space::BT709 => AVCOL_SPC_BT709, Space::Unspecified => AVCOL_SPC_UNSPECIFIED, diff --git a/src/util/color/transfer_characteristic.rs b/src/util/color/transfer_characteristic.rs index 70e16d1..e35aad0 100644 --- a/src/util/color/transfer_characteristic.rs +++ b/src/util/color/transfer_characteristic.rs @@ -67,9 +67,9 @@ impl From for TransferCharacteristic { } } -impl Into for TransferCharacteristic { - fn into(self) -> AVColorTransferCharacteristic { - match self { +impl From for AVColorTransferCharacteristic { + fn from(value: TransferCharacteristic) -> AVColorTransferCharacteristic { + match value { TransferCharacteristic::Reserved0 => AVCOL_TRC_RESERVED0, TransferCharacteristic::BT709 => AVCOL_TRC_BT709, TransferCharacteristic::Unspecified => AVCOL_TRC_UNSPECIFIED, diff --git a/src/util/error.rs b/src/util/error.rs index d8fb23e..e3ae2a8 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -100,9 +100,9 @@ impl From for Error { } } -impl Into for Error { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Error) -> c_int { + match value { Error::BsfNotFound => AVERROR_BSF_NOT_FOUND, Error::Bug => AVERROR_BUG, Error::BufferTooSmall => AVERROR_BUFFER_TOO_SMALL, @@ -202,7 +202,7 @@ fn index(error: &Error) -> usize { // XXX: the length has to be synced with the number of errors static mut STRINGS: [[c_char; AV_ERROR_MAX_STRING_SIZE]; 27] = - [[0 as c_char; AV_ERROR_MAX_STRING_SIZE]; 27]; + [[0_i8; AV_ERROR_MAX_STRING_SIZE]; 27]; pub fn register_all() { unsafe { diff --git a/src/util/format/pixel.rs b/src/util/format/pixel.rs index 53f9916..346f6ad 100644 --- a/src/util/format/pixel.rs +++ b/src/util/format/pixel.rs @@ -702,10 +702,10 @@ impl From for Pixel { } } -impl Into for Pixel { +impl From for AVPixelFormat { #[inline] - fn into(self) -> AVPixelFormat { - match self { + fn from(value: Pixel) -> AVPixelFormat { + match value { Pixel::None => AV_PIX_FMT_NONE, Pixel::YUV420P => AV_PIX_FMT_YUV420P, diff --git a/src/util/format/sample.rs b/src/util/format/sample.rs index 42ab7c5..7f1b14d 100644 --- a/src/util/format/sample.rs +++ b/src/util/format/sample.rs @@ -101,10 +101,10 @@ impl From<&'static str> for Sample { } } -impl Into for Sample { +impl From for AVSampleFormat { #[inline] - fn into(self) -> AVSampleFormat { - match self { + fn from(value: Sample) -> AVSampleFormat { + match value { Sample::None => AV_SAMPLE_FMT_NONE, Sample::U8(Type::Packed) => AV_SAMPLE_FMT_U8, diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index ea98dfd..ca073f8 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -47,7 +47,7 @@ pub enum Type { #[cfg(feature = "ffmpeg_4_4")] SEI_UNREGISTERED, #[cfg(feature = "ffmpeg_4_4")] - FILM_GRAIN_PARAMS + FILM_GRAIN_PARAMS, } impl Type { @@ -100,15 +100,15 @@ impl From for Type { #[cfg(feature = "ffmpeg_4_4")] AV_FRAME_DATA_SEI_UNREGISTERED => Type::SEI_UNREGISTERED, #[cfg(feature = "ffmpeg_4_4")] - AV_FRAME_DATA_FILM_GRAIN_PARAMS => Type::FILM_GRAIN_PARAMS + AV_FRAME_DATA_FILM_GRAIN_PARAMS => Type::FILM_GRAIN_PARAMS, } } } -impl Into for Type { +impl From for AVFrameSideDataType { #[inline(always)] - fn into(self) -> AVFrameSideDataType { - match self { + fn from(value: Type) -> AVFrameSideDataType { + match value { Type::PanScan => AV_FRAME_DATA_PANSCAN, Type::A53CC => AV_FRAME_DATA_A53_CC, Type::Stereo3D => AV_FRAME_DATA_STEREO3D, @@ -146,7 +146,7 @@ impl Into for Type { #[cfg(feature = "ffmpeg_4_4")] Type::SEI_UNREGISTERED => AV_FRAME_DATA_SEI_UNREGISTERED, #[cfg(feature = "ffmpeg_4_4")] - Type::FILM_GRAIN_PARAMS => AV_FRAME_DATA_FILM_GRAIN_PARAMS + Type::FILM_GRAIN_PARAMS => AV_FRAME_DATA_FILM_GRAIN_PARAMS, } } } diff --git a/src/util/log/level.rs b/src/util/log/level.rs index c79aad7..2c18492 100644 --- a/src/util/log/level.rs +++ b/src/util/log/level.rs @@ -37,9 +37,9 @@ impl TryFrom for Level { } } -impl Into for Level { - fn into(self) -> c_int { - match self { +impl From for c_int { + fn from(value: Level) -> c_int { + match value { Level::Quiet => AV_LOG_QUIET, Level::Panic => AV_LOG_PANIC, Level::Fatal => AV_LOG_FATAL, diff --git a/src/util/mathematics/rounding.rs b/src/util/mathematics/rounding.rs index 6ed17da..b3d279d 100644 --- a/src/util/mathematics/rounding.rs +++ b/src/util/mathematics/rounding.rs @@ -25,10 +25,10 @@ impl From for Rounding { } } -impl Into for Rounding { +impl From for AVRounding { #[inline(always)] - fn into(self) -> AVRounding { - match self { + fn from(value: Rounding) -> AVRounding { + match value { Rounding::Zero => AV_ROUND_ZERO, Rounding::Infinity => AV_ROUND_INF, Rounding::Down => AV_ROUND_DOWN, diff --git a/src/util/media.rs b/src/util/media.rs index b57f5df..531f624 100644 --- a/src/util/media.rs +++ b/src/util/media.rs @@ -26,10 +26,10 @@ impl From for Type { } } -impl Into for Type { +impl From for AVMediaType { #[inline(always)] - fn into(self) -> AVMediaType { - match self { + fn from(value: Type) -> AVMediaType { + match value { Type::Unknown => AVMEDIA_TYPE_UNKNOWN, Type::Video => AVMEDIA_TYPE_VIDEO, Type::Audio => AVMEDIA_TYPE_AUDIO, diff --git a/src/util/option/mod.rs b/src/util/option/mod.rs index c42a24b..4d683d0 100644 --- a/src/util/option/mod.rs +++ b/src/util/option/mod.rs @@ -55,9 +55,9 @@ impl From for Type { } } -impl Into for Type { - fn into(self) -> AVOptionType { - match self { +impl From for AVOptionType { + fn from(value: Type) -> AVOptionType { + match value { Type::Flags => AV_OPT_TYPE_FLAGS, Type::Int => AV_OPT_TYPE_INT, Type::Int64 => AV_OPT_TYPE_INT64, diff --git a/src/util/picture.rs b/src/util/picture.rs index 69aa99f..c89a918 100644 --- a/src/util/picture.rs +++ b/src/util/picture.rs @@ -29,10 +29,10 @@ impl From for Type { } } -impl Into for Type { +impl From for AVPictureType { #[inline(always)] - fn into(self) -> AVPictureType { - match self { + fn from(value: Type) -> AVPictureType { + match value { Type::None => AV_PICTURE_TYPE_NONE, Type::I => AV_PICTURE_TYPE_I, Type::P => AV_PICTURE_TYPE_P, diff --git a/src/util/rational.rs b/src/util/rational.rs index 6fe82b8..4134eb0 100644 --- a/src/util/rational.rs +++ b/src/util/rational.rs @@ -67,12 +67,12 @@ impl From for Rational { } } -impl Into for Rational { +impl From for AVRational { #[inline] - fn into(self) -> AVRational { + fn from(value: Rational) -> AVRational { AVRational { - num: self.0, - den: self.1, + num: value.0, + den: value.1, } } }