From c4a06e515b34f52b1227b5c11621a2f729b148fb Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 7 Jan 2021 20:47:31 +0100 Subject: [PATCH] gstreamer/format,value: Skip init in functions that contain `self` These functions were changed to return Self instead of the direct name of the type, and are hence caught by the init checker. Also remove some tabs that sit in the macro but are not cleaned up by the formatter. --- gstreamer/src/format.rs | 10 ++++++---- gstreamer/src/value.rs | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gstreamer/src/format.rs b/gstreamer/src/format.rs index 65c3e012d..7f3d224d8 100644 --- a/gstreamer/src/format.rs +++ b/gstreamer/src/format.rs @@ -298,7 +298,7 @@ macro_rules! impl_format_value_traits( impl From<$name> for GenericFormattedValue { fn from(v: $name) -> Self { - skip_assert_initialized!(); + skip_assert_initialized!(); GenericFormattedValue::$format_value(v) } } @@ -307,7 +307,7 @@ macro_rules! impl_format_value_traits( type Error = TryFromGenericFormattedValueError; fn try_from(v: GenericFormattedValue) -> Result<$name, Self::Error> { - skip_assert_initialized!(); + skip_assert_initialized!(); if let GenericFormattedValue::$format_value(v) = v { Ok(v) } else { @@ -320,20 +320,21 @@ macro_rules! impl_format_value_traits( impl From for $name { fn from(v: u64) -> Self { - skip_assert_initialized!(); + skip_assert_initialized!(); $name(Some(v)) } } impl From> for $name { fn from(v: Option) -> Self { - skip_assert_initialized!(); + skip_assert_initialized!(); $name(v) } } impl From<$name> for Option { fn from(v: $name) -> Self { + skip_assert_initialized!(); v.0 } } @@ -568,6 +569,7 @@ impl From for Undefined { impl From for i64 { fn from(u: Undefined) -> Self { + skip_assert_initialized!(); u.0 } } diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index 120497a1e..dcf5902c1 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -218,6 +218,7 @@ impl From<(i32, i32)> for Fraction { impl From for (i32, i32) { fn from(f: Fraction) -> Self { + skip_assert_initialized!(); f.0.into() } }