From 2447664df65d741d55a6a3962998f7c30b47c390 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Sat, 28 Nov 2020 12:33:46 +0100 Subject: [PATCH] Replace Result<(), fmt::Error> with fmt::Result --- gstreamer-audio/src/audio_format.rs | 2 +- gstreamer-audio/src/audio_format_info.rs | 4 ++-- gstreamer-audio/src/audio_info.rs | 2 +- gstreamer-audio/src/audio_ring_buffer_spec.rs | 2 +- gstreamer-base/src/base_parse_frame.rs | 2 +- gstreamer-video/src/video_codec_frame.rs | 2 +- gstreamer-video/src/video_codec_state.rs | 2 +- gstreamer-video/src/video_format.rs | 2 +- gstreamer-video/src/video_format_info.rs | 4 ++-- gstreamer-video/src/video_info.rs | 12 ++++++------ gstreamer-video/src/video_time_code.rs | 2 +- gstreamer-video/src/video_time_code_interval.rs | 4 ++-- gstreamer/src/clock_time.rs | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gstreamer-audio/src/audio_format.rs b/gstreamer-audio/src/audio_format.rs index cdb174ed8..8d296fee0 100644 --- a/gstreamer-audio/src/audio_format.rs +++ b/gstreamer-audio/src/audio_format.rs @@ -157,7 +157,7 @@ impl str::FromStr for crate::AudioFormat { } impl fmt::Display for crate::AudioFormat { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str((*self).to_str()) } } diff --git a/gstreamer-audio/src/audio_format_info.rs b/gstreamer-audio/src/audio_format_info.rs index 3bf3b8325..1ea4d68d7 100644 --- a/gstreamer-audio/src/audio_format_info.rs +++ b/gstreamer-audio/src/audio_format_info.rs @@ -269,7 +269,7 @@ impl Ord for AudioFormatInfo { } impl fmt::Debug for AudioFormatInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AudioFormatInfo") .field("format", &self.format()) .field("name", &self.name()) @@ -284,7 +284,7 @@ impl fmt::Debug for AudioFormatInfo { } impl fmt::Display for AudioFormatInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.name()) } } diff --git a/gstreamer-audio/src/audio_info.rs b/gstreamer-audio/src/audio_info.rs index 8a6b6802d..9c596471d 100644 --- a/gstreamer-audio/src/audio_info.rs +++ b/gstreamer-audio/src/audio_info.rs @@ -18,7 +18,7 @@ use std::ptr; pub struct AudioInfo(ffi::GstAudioInfo, [crate::AudioChannelPosition; 64]); impl fmt::Debug for AudioInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AudioInfo") .field("format-info", &self.format_info()) .field("rate", &self.rate()) diff --git a/gstreamer-audio/src/audio_ring_buffer_spec.rs b/gstreamer-audio/src/audio_ring_buffer_spec.rs index 408d76b7b..191fc8a5a 100644 --- a/gstreamer-audio/src/audio_ring_buffer_spec.rs +++ b/gstreamer-audio/src/audio_ring_buffer_spec.rs @@ -91,7 +91,7 @@ unsafe impl Send for AudioRingBufferSpec {} unsafe impl Sync for AudioRingBufferSpec {} impl fmt::Debug for AudioRingBufferSpec { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AudioRingBufferSpec") .field("type", &self.get_type()) .field("caps", &self.get_caps()) diff --git a/gstreamer-base/src/base_parse_frame.rs b/gstreamer-base/src/base_parse_frame.rs index ea2f97aab..d35283a91 100644 --- a/gstreamer-base/src/base_parse_frame.rs +++ b/gstreamer-base/src/base_parse_frame.rs @@ -70,7 +70,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstBaseParseFrame> for BaseP } impl<'a> fmt::Debug for BaseParseFrame<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut b = f.debug_struct("BaseParseFrame"); b.field("buffer", &self.get_buffer()) diff --git a/gstreamer-video/src/video_codec_frame.rs b/gstreamer-video/src/video_codec_frame.rs index 1e23a5a68..3fbbd2a14 100644 --- a/gstreamer-video/src/video_codec_frame.rs +++ b/gstreamer-video/src/video_codec_frame.rs @@ -34,7 +34,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstVideoCodecFrame> for Vide } impl<'a> fmt::Debug for VideoCodecFrame<'a> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut b = f.debug_struct("VideoCodecFrame"); b.field("flags", &self.get_flags()) diff --git a/gstreamer-video/src/video_codec_state.rs b/gstreamer-video/src/video_codec_state.rs index 9455a6058..d13226851 100644 --- a/gstreamer-video/src/video_codec_state.rs +++ b/gstreamer-video/src/video_codec_state.rs @@ -54,7 +54,7 @@ pub struct VideoCodecState<'a, T: VideoCodecStateContext<'a>> { } impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoCodecState") .field("info", &self.get_info()) .field("caps", &self.get_caps()) diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index 547569d4b..4b34b7483 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -359,7 +359,7 @@ impl str::FromStr for crate::VideoFormat { } impl fmt::Display for crate::VideoFormat { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str((*self).to_str()) } } diff --git a/gstreamer-video/src/video_format_info.rs b/gstreamer-video/src/video_format_info.rs index 510535d7d..33de36d69 100644 --- a/gstreamer-video/src/video_format_info.rs +++ b/gstreamer-video/src/video_format_info.rs @@ -397,7 +397,7 @@ impl Ord for VideoFormatInfo { } impl fmt::Debug for VideoFormatInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoFormatInfo") .field("format", &self.format()) .field("name", &self.name()) @@ -423,7 +423,7 @@ impl fmt::Debug for VideoFormatInfo { } impl fmt::Display for VideoFormatInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(self.name()) } } diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index 6b52687df..c7e2a9f40 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -158,7 +158,7 @@ impl str::FromStr for crate::VideoColorimetry { } impl fmt::Debug for crate::VideoColorimetry { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoColorimetry") .field("range", &self.0.range) .field("matrix", &self.0.matrix) @@ -169,7 +169,7 @@ impl fmt::Debug for crate::VideoColorimetry { } impl fmt::Display for crate::VideoColorimetry { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let s = unsafe { glib::GString::from_glib_full(ffi::gst_video_colorimetry_to_string(&self.0)) }; f.write_str(&s) @@ -194,7 +194,7 @@ impl str::FromStr for crate::VideoChromaSite { } impl fmt::Display for crate::VideoChromaSite { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let s = unsafe { glib::GString::from_glib_full(ffi::gst_video_chroma_to_string(self.to_glib())) }; @@ -320,7 +320,7 @@ impl std::convert::TryFrom for crate::VideoMultiviewF pub struct VideoInfo(pub(crate) ffi::GstVideoInfo); impl fmt::Debug for VideoInfo { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut b = f.debug_struct("VideoInfo"); b.field("format", &self.format()) @@ -1048,7 +1048,7 @@ impl str::FromStr for crate::VideoFieldOrder { #[cfg(any(feature = "v1_12", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] impl fmt::Display for crate::VideoFieldOrder { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str((*self).to_str()) } } @@ -1078,7 +1078,7 @@ impl str::FromStr for crate::VideoInterlaceMode { } impl fmt::Display for crate::VideoInterlaceMode { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str((*self).to_str()) } } diff --git a/gstreamer-video/src/video_time_code.rs b/gstreamer-video/src/video_time_code.rs index 06a8f957b..59028dbce 100644 --- a/gstreamer-video/src/video_time_code.rs +++ b/gstreamer-video/src/video_time_code.rs @@ -314,7 +314,7 @@ macro_rules! generic_impl { } impl fmt::Debug for $name { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct(stringify!($name)) .field("fps", &self.get_fps()) .field("flags", &self.get_flags()) diff --git a/gstreamer-video/src/video_time_code_interval.rs b/gstreamer-video/src/video_time_code_interval.rs index f861a97a1..12dbd5525 100644 --- a/gstreamer-video/src/video_time_code_interval.rs +++ b/gstreamer-video/src/video_time_code_interval.rs @@ -97,7 +97,7 @@ impl Ord for VideoTimeCodeInterval { } impl fmt::Debug for VideoTimeCodeInterval { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoTimeCodeInterval") .field("hours", &self.0.hours) .field("minutes", &self.0.minutes) @@ -108,7 +108,7 @@ impl fmt::Debug for VideoTimeCodeInterval { } impl fmt::Display for VideoTimeCodeInterval { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "{:02}:{:02}:{:02}:{:02}", diff --git a/gstreamer/src/clock_time.rs b/gstreamer/src/clock_time.rs index d676f5cb9..907521269 100644 --- a/gstreamer/src/clock_time.rs +++ b/gstreamer/src/clock_time.rs @@ -139,7 +139,7 @@ impl_common_ops_for_opt_int!(ClockTime); impl fmt::Display for ClockTime { #[allow(clippy::many_single_char_names)] - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let precision = f.precision().unwrap_or(9); // TODO: Could also check width and pad the hours as needed