Replace explicit type with Self in for_value_type::<> turbofish

This commit is contained in:
Marijn Suijten 2021-04-25 18:46:18 +02:00
parent e8f340c60a
commit 10c93807fb
13 changed files with 29 additions and 29 deletions

View file

@ -332,7 +332,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for AudioFormatInfo {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for AudioFormatInfo { impl glib::value::ToValue for AudioFormatInfo {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<AudioFormatInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -351,7 +351,7 @@ impl glib::value::ToValue for AudioFormatInfo {
impl glib::value::ToValueOptional for AudioFormatInfo { impl glib::value::ToValueOptional for AudioFormatInfo {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<AudioFormatInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -343,7 +343,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for AudioInfo {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for AudioInfo { impl glib::value::ToValue for AudioInfo {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<AudioInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -362,7 +362,7 @@ impl glib::value::ToValue for AudioInfo {
impl glib::value::ToValueOptional for AudioInfo { impl glib::value::ToValueOptional for AudioInfo {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<AudioInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -70,7 +70,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for VideoColorRange {
impl glib::value::ToValue for VideoColorRange { impl glib::value::ToValue for VideoColorRange {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<VideoColorRange>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()) } unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()) }
value value
} }
@ -84,7 +84,7 @@ pub struct VideoColorimetry(ffi::GstVideoColorimetry);
impl VideoColorimetry { impl VideoColorimetry {
pub fn new( pub fn new(
range: VideoColorRange, range: crate::VideoColorRange,
matrix: crate::VideoColorMatrix, matrix: crate::VideoColorMatrix,
transfer: crate::VideoTransferFunction, transfer: crate::VideoTransferFunction,
primaries: crate::VideoColorPrimaries, primaries: crate::VideoColorPrimaries,
@ -884,7 +884,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for VideoInfo {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for VideoInfo { impl glib::value::ToValue for VideoInfo {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<VideoInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -903,7 +903,7 @@ impl glib::value::ToValue for VideoInfo {
impl glib::value::ToValueOptional for VideoInfo { impl glib::value::ToValueOptional for VideoInfo {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<VideoInfo>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -445,7 +445,7 @@ macro_rules! generic_impl {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for $name { impl glib::value::ToValue for $name {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<$name>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -464,7 +464,7 @@ macro_rules! generic_impl {
impl glib::value::ToValueOptional for $name { impl glib::value::ToValueOptional for $name {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<$name>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -218,7 +218,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for VideoTimeCodeInterval {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for VideoTimeCodeInterval { impl glib::value::ToValue for VideoTimeCodeInterval {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<VideoTimeCodeInterval>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -237,7 +237,7 @@ impl glib::value::ToValue for VideoTimeCodeInterval {
impl glib::value::ToValueOptional for VideoTimeCodeInterval { impl glib::value::ToValueOptional for VideoTimeCodeInterval {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<VideoTimeCodeInterval>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -241,7 +241,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for CapsFeatures {
impl glib::value::ToValue for CapsFeatures { impl glib::value::ToValue for CapsFeatures {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<CapsFeatures>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -259,7 +259,7 @@ impl glib::value::ToValue for CapsFeatures {
impl glib::value::ToValueOptional for CapsFeatures { impl glib::value::ToValueOptional for CapsFeatures {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<CapsFeatures>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -324,7 +324,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for ClockTime {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for ClockTime { impl glib::value::ToValue for ClockTime {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<ClockTime>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_uint64(value.to_glib_none_mut().0, self.into_glib()) glib::gobject_ffi::g_value_set_uint64(value.to_glib_none_mut().0, self.into_glib())
} }

View file

@ -624,7 +624,7 @@ unsafe impl<'a> FromValue<'a> for MessageType {
impl ToValue for MessageType { impl ToValue for MessageType {
fn to_value(&self) -> Value { fn to_value(&self) -> Value {
let mut value = glib::Value::for_value_type::<MessageType>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib() as i32) glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib() as i32)
} }

View file

@ -441,7 +441,7 @@ macro_rules! mini_object_wrapper (
impl $crate::glib::value::ToValue for $name { impl $crate::glib::value::ToValue for $name {
fn to_value(&self) -> $crate::glib::Value { fn to_value(&self) -> $crate::glib::Value {
let mut value = $crate::glib::Value::for_value_type::<$name>(); let mut value = $crate::glib::Value::for_value_type::<Self>();
unsafe { unsafe {
$crate::glib::gobject_ffi::g_value_set_boxed( $crate::glib::gobject_ffi::g_value_set_boxed(
$crate::glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, $crate::glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0,
@ -459,7 +459,7 @@ macro_rules! mini_object_wrapper (
impl $crate::glib::value::ToValueOptional for $name { impl $crate::glib::value::ToValueOptional for $name {
fn to_value_optional(s: Option<&Self>) -> $crate::glib::Value { fn to_value_optional(s: Option<&Self>) -> $crate::glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = $crate::glib::Value::for_value_type::<$name>(); let mut value = $crate::glib::Value::for_value_type::<Self>();
unsafe { unsafe {
$crate::glib::gobject_ffi::g_value_set_boxed( $crate::glib::gobject_ffi::g_value_set_boxed(
$crate::glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0, $crate::glib::translate::ToGlibPtrMut::to_glib_none_mut(&mut value).0,

View file

@ -55,7 +55,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for StaticCaps {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for StaticCaps { impl glib::value::ToValue for StaticCaps {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<StaticCaps>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -74,7 +74,7 @@ impl glib::value::ToValue for StaticCaps {
impl glib::value::ToValueOptional for StaticCaps { impl glib::value::ToValueOptional for StaticCaps {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<StaticCaps>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -84,7 +84,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for StaticPadTemplate {
#[doc(hidden)] #[doc(hidden)]
impl glib::value::ToValue for StaticPadTemplate { impl glib::value::ToValue for StaticPadTemplate {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<StaticPadTemplate>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -103,7 +103,7 @@ impl glib::value::ToValue for StaticPadTemplate {
impl glib::value::ToValueOptional for StaticPadTemplate { impl glib::value::ToValueOptional for StaticPadTemplate {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<StaticPadTemplate>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -316,7 +316,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for Structure {
impl glib::value::ToValue for Structure { impl glib::value::ToValue for Structure {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Structure>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -335,7 +335,7 @@ impl glib::value::ToValue for Structure {
impl glib::value::ToValueOptional for Structure { impl glib::value::ToValueOptional for Structure {
fn to_value_optional(s: Option<&Self>) -> glib::Value { fn to_value_optional(s: Option<&Self>) -> glib::Value {
skip_assert_initialized!(); skip_assert_initialized!();
let mut value = glib::Value::for_value_type::<Structure>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
glib::gobject_ffi::g_value_set_boxed( glib::gobject_ffi::g_value_set_boxed(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,

View file

@ -262,7 +262,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for Fraction {
impl glib::value::ToValue for Fraction { impl glib::value::ToValue for Fraction {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Fraction>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
ffi::gst_value_set_fraction(value.to_glib_none_mut().0, *self.numer(), *self.denom()); ffi::gst_value_set_fraction(value.to_glib_none_mut().0, *self.numer(), *self.denom());
} }
@ -381,7 +381,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for IntRange<i32> {
impl glib::value::ToValue for IntRange<i32> { impl glib::value::ToValue for IntRange<i32> {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<IntRange<i32>>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
ffi::gst_value_set_int_range_step( ffi::gst_value_set_int_range_step(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -423,7 +423,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for IntRange<i64> {
impl glib::value::ToValue for IntRange<i64> { impl glib::value::ToValue for IntRange<i64> {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<IntRange<i64>>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
ffi::gst_value_set_int64_range_step( ffi::gst_value_set_int64_range_step(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -505,7 +505,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for FractionRange {
impl glib::value::ToValue for FractionRange { impl glib::value::ToValue for FractionRange {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<FractionRange>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
ffi::gst_value_set_fraction_range_full( ffi::gst_value_set_fraction_range_full(
value.to_glib_none_mut().0, value.to_glib_none_mut().0,
@ -609,7 +609,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for Bitmask {
impl glib::value::ToValue for Bitmask { impl glib::value::ToValue for Bitmask {
fn to_value(&self) -> glib::Value { fn to_value(&self) -> glib::Value {
let mut value = glib::Value::for_value_type::<Bitmask>(); let mut value = glib::Value::for_value_type::<Self>();
unsafe { unsafe {
ffi::gst_value_set_bitmask(value.to_glib_none_mut().0, self.0); ffi::gst_value_set_bitmask(value.to_glib_none_mut().0, self.0);
} }