diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index fe71103bd..39641dc19 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -503,7 +503,9 @@ impl VideoInfo { pub fn multiview_flags(&self) -> ::VideoMultiviewFlags { unsafe { let ptr = &self.0._gst_reserved as *const _ as *const u32; - from_glib(ffi::GstVideoMultiviewFlags::from_bits_truncate(ptr::read(ptr.offset(1)))) + from_glib(ffi::GstVideoMultiviewFlags::from_bits_truncate( + ptr::read(ptr.offset(1)), + )) } } diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index 065935ba5..17bf30099 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -98,7 +98,9 @@ impl ToOwned for BufferListRef { impl fmt::Debug for BufferListRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let size = self.iter().map(|b| b.get_size()).sum::(); - let (pts, dts) = self.get(0).map(|b| (b.get_pts(), b.get_dts())).unwrap_or((::ClockTime::none(), ::ClockTime::none())); + let (pts, dts) = self.get(0) + .map(|b| (b.get_pts(), b.get_dts())) + .unwrap_or((::ClockTime::none(), ::ClockTime::none())); f.debug_struct("BufferList") .field("buffers", &self.len()) diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 77a348b3b..049b3b8e8 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -345,9 +345,7 @@ define_iter!(IterMut, &'a mut CapsRef, &'a mut StructureRef); impl fmt::Debug for CapsRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("Caps") - .field(&self.to_string()) - .finish() + f.debug_tuple("Caps").field(&self.to_string()).finish() } } diff --git a/gstreamer/src/date_time.rs b/gstreamer/src/date_time.rs index fe7ff9f77..62419fd53 100644 --- a/gstreamer/src/date_time.rs +++ b/gstreamer/src/date_time.rs @@ -11,6 +11,10 @@ use std::fmt; impl fmt::Display for DateTime { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str(self.to_iso8601_string().unwrap_or(String::from("None")).as_str()) + f.write_str( + self.to_iso8601_string() + .unwrap_or(String::from("None")) + .as_str(), + ) } } diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index f5a276610..bc9f99afa 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -376,7 +376,7 @@ impl glib::types::StaticType for EventRef { impl fmt::Debug for EventRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Event") - .field("type", & unsafe { + .field("type", &unsafe { let type_ = ffi::gst_event_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap() }) diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 37771c9d7..a240b77e3 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -316,17 +316,13 @@ impl GstRc { } #[cfg(any(feature = "v1_10", feature = "dox"))] - pub fn new_stream_collection( - collection: &::StreamCollection, - ) -> StreamCollectionBuilder { + pub fn new_stream_collection(collection: &::StreamCollection) -> StreamCollectionBuilder { assert_initialized_main_thread!(); StreamCollectionBuilder::new(collection) } #[cfg(any(feature = "v1_10", feature = "dox"))] - pub fn new_streams_selected( - collection: &::StreamCollection, - ) -> StreamsSelectedBuilder { + pub fn new_streams_selected(collection: &::StreamCollection) -> StreamsSelectedBuilder { assert_initialized_main_thread!(); StreamsSelectedBuilder::new(collection) } @@ -351,7 +347,7 @@ impl glib::types::StaticType for MessageRef { impl fmt::Debug for MessageRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Message") - .field("type", & unsafe { + .field("type", &unsafe { let type_ = ffi::gst_message_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap() }) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 133efe579..36264162f 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -165,8 +165,7 @@ pub trait PadExtManual { fn set_getrange_function(&self, func: F) where - F: Fn(&Pad, &Option<::Object>, u64, u32) - -> Result<::Buffer, ::FlowReturn> + F: Fn(&Pad, &Option<::Object>, u64, u32) -> Result<::Buffer, ::FlowReturn> + Send + Sync + 'static; @@ -510,8 +509,7 @@ impl> PadExtManual for O { fn set_getrange_function(&self, func: F) where - F: Fn(&Pad, &Option<::Object>, u64, u32) - -> Result<::Buffer, ::FlowReturn> + F: Fn(&Pad, &Option<::Object>, u64, u32) -> Result<::Buffer, ::FlowReturn> + Send + Sync + 'static, @@ -519,8 +517,7 @@ impl> PadExtManual for O { unsafe { #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] let func_box: Box< - Fn(&Pad, &Option<::Object>, u64, u32) - -> Result<::Buffer, ::FlowReturn> + Fn(&Pad, &Option<::Object>, u64, u32) -> Result<::Buffer, ::FlowReturn> + Send + Sync + 'static, @@ -925,8 +922,7 @@ unsafe extern "C" fn trampoline_getrange_function( ) -> ffi::GstFlowReturn { let _guard = CallbackGuard::new(); #[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] - let func: &&(Fn(&Pad, &Option<::Object>, u64, u32) - -> Result<::Buffer, ::FlowReturn> + let func: &&(Fn(&Pad, &Option<::Object>, u64, u32) -> Result<::Buffer, ::FlowReturn> + Send + Sync + 'static) = transmute((*pad).getrangedata); diff --git a/gstreamer/src/query.rs b/gstreamer/src/query.rs index 81d804fad..618ad8315 100644 --- a/gstreamer/src/query.rs +++ b/gstreamer/src/query.rs @@ -186,7 +186,7 @@ impl glib::types::StaticType for QueryRef { impl fmt::Debug for QueryRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Query") - .field("type", & unsafe { + .field("type", &unsafe { let type_ = ffi::gst_query_type_get_name((*self.as_ptr()).type_); CStr::from_ptr(type_).to_str().unwrap() }) diff --git a/gstreamer/src/segment.rs b/gstreamer/src/segment.rs index 032f54eaa..d22f96d60 100644 --- a/gstreamer/src/segment.rs +++ b/gstreamer/src/segment.rs @@ -320,42 +320,41 @@ impl Clone for Segment { impl fmt::Debug for Segment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.get_format() { - Format::Undefined => { - f.debug_struct("Segment") - .field("format", &Format::Undefined) - .finish() - }, - Format::Time => { - f.debug_struct("Segment") - .field("format", &Format::Time) - .field("start", &ClockTime::from(self.get_start()).to_string()) - .field("offset", &ClockTime::from(self.get_offset()).to_string()) - .field("stop", &ClockTime::from(self.get_stop()).to_string()) - .field("rate", &self.get_rate()) - .field("applied_rate", &self.get_applied_rate()) - .field("flags", &self.get_flags()) - .field("time", &ClockTime::from(self.get_time()).to_string()) - .field("base", &ClockTime::from(self.get_base()).to_string()) - .field("position", &ClockTime::from(self.get_position()).to_string()) - .field("duration", &ClockTime::from(self.get_duration()).to_string()) - .finish() - }, - _ => { - f.debug_struct("Segment") - .field("format", &self.get_format()) - .field("start", &self.get_start()) - .field("offset", &self.get_offset()) - .field("stop", &self.get_stop()) - .field("rate", &self.get_rate()) - .field("applied_rate", &self.get_applied_rate()) - .field("flags", &self.get_flags()) - .field("time", &self.get_time()) - .field("base", &self.get_base()) - .field("position", &self.get_position()) - .field("duration", &self.get_duration()) - .finish() - } - + Format::Undefined => f.debug_struct("Segment") + .field("format", &Format::Undefined) + .finish(), + Format::Time => f.debug_struct("Segment") + .field("format", &Format::Time) + .field("start", &ClockTime::from(self.get_start()).to_string()) + .field("offset", &ClockTime::from(self.get_offset()).to_string()) + .field("stop", &ClockTime::from(self.get_stop()).to_string()) + .field("rate", &self.get_rate()) + .field("applied_rate", &self.get_applied_rate()) + .field("flags", &self.get_flags()) + .field("time", &ClockTime::from(self.get_time()).to_string()) + .field("base", &ClockTime::from(self.get_base()).to_string()) + .field( + "position", + &ClockTime::from(self.get_position()).to_string(), + ) + .field( + "duration", + &ClockTime::from(self.get_duration()).to_string(), + ) + .finish(), + _ => f.debug_struct("Segment") + .field("format", &self.get_format()) + .field("start", &self.get_start()) + .field("offset", &self.get_offset()) + .field("stop", &self.get_stop()) + .field("rate", &self.get_rate()) + .field("applied_rate", &self.get_applied_rate()) + .field("flags", &self.get_flags()) + .field("time", &self.get_time()) + .field("base", &self.get_base()) + .field("position", &self.get_position()) + .field("duration", &self.get_duration()) + .finish(), } } } diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index a5b9a955a..dbb7a5501 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -116,9 +116,7 @@ impl Drop for Structure { impl fmt::Debug for Structure { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("Structure") - .field(&self.to_string()) - .finish() + f.debug_tuple("Structure").field(&self.to_string()).finish() } } diff --git a/gstreamer/src/tags.rs b/gstreamer/src/tags.rs index 1814a865f..d1c927911 100644 --- a/gstreamer/src/tags.rs +++ b/gstreamer/src/tags.rs @@ -322,15 +322,19 @@ impl TagListRef { } pub fn merge(&self, other: &TagListRef, mode: TagMergeMode) -> TagList { - unsafe { from_glib_full(ffi::gst_tag_list_merge(self.as_ptr(), other.as_ptr(), mode.to_glib())) } + unsafe { + from_glib_full(ffi::gst_tag_list_merge( + self.as_ptr(), + other.as_ptr(), + mode.to_glib(), + )) + } } } impl fmt::Debug for TagListRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("TagList") - .field(&self.to_string()) - .finish() + f.debug_tuple("TagList").field(&self.to_string()).finish() } }