From 62e9af58c6b41866e0e12e4a4ca10b64c1a0943f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 11 Apr 2020 21:18:18 +0300 Subject: [PATCH] Fix some clippy warnings --- gstreamer-player/src/config.rs | 3 +-- gstreamer-video/src/video_codec_frame.rs | 4 +--- gstreamer-webrtc/src/web_rtc_session_description.rs | 5 ++--- gstreamer/src/caps_features.rs | 4 +--- gstreamer/src/miniobject.rs | 4 +--- gstreamer/src/structure.rs | 4 +--- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/gstreamer-player/src/config.rs b/gstreamer-player/src/config.rs index ce5e0f2d8..6e7c2bcdd 100644 --- a/gstreamer-player/src/config.rs +++ b/gstreamer-player/src/config.rs @@ -98,8 +98,7 @@ impl PlayerConfig { pub unsafe fn into_ptr(self) -> *mut gst_sys::GstStructure { let mut s = mem::ManuallyDrop::new(self); - let ptr = s.0.to_glib_none_mut().0; - ptr + s.0.to_glib_none_mut().0 } } diff --git a/gstreamer-video/src/video_codec_frame.rs b/gstreamer-video/src/video_codec_frame.rs index 1a9a2f1c1..1c63347e9 100644 --- a/gstreamer-video/src/video_codec_frame.rs +++ b/gstreamer-video/src/video_codec_frame.rs @@ -199,9 +199,7 @@ impl<'a> VideoCodecFrame<'a> { glib_sys::g_rec_mutex_unlock(stream_lock); let s = mem::ManuallyDrop::new(self); - let ptr = s.to_glib_none().0; - - ptr + s.to_glib_none().0 } } diff --git a/gstreamer-webrtc/src/web_rtc_session_description.rs b/gstreamer-webrtc/src/web_rtc_session_description.rs index 78861c69a..692afd355 100644 --- a/gstreamer-webrtc/src/web_rtc_session_description.rs +++ b/gstreamer-webrtc/src/web_rtc_session_description.rs @@ -18,11 +18,10 @@ impl WebRTCSessionDescription { assert_initialized_main_thread!(); unsafe { let mut sdp = mem::ManuallyDrop::new(sdp); - let desc = from_glib_full(gst_web_rtc_sys::gst_webrtc_session_description_new( + from_glib_full(gst_web_rtc_sys::gst_webrtc_session_description_new( type_.to_glib(), sdp.to_glib_none_mut().0, - )); - desc + )) } } diff --git a/gstreamer/src/caps_features.rs b/gstreamer/src/caps_features.rs index 0d1a25d24..05d9b763c 100644 --- a/gstreamer/src/caps_features.rs +++ b/gstreamer/src/caps_features.rs @@ -67,9 +67,7 @@ impl CapsFeatures { pub unsafe fn into_ptr(self) -> *mut gst_sys::GstCapsFeatures { let s = mem::ManuallyDrop::new(self); - let ptr = s.0.as_ptr() as *mut CapsFeaturesRef as *mut gst_sys::GstCapsFeatures; - - ptr + s.0.as_ptr() as *mut CapsFeaturesRef as *mut gst_sys::GstCapsFeatures } } diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index 18a8162fc..c1e79aad3 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -92,9 +92,7 @@ impl GstRc { pub unsafe fn into_ptr(self) -> *mut T::GstType { let s = mem::ManuallyDrop::new(self); - let ptr = s.as_mut_ptr(); - - ptr + s.as_mut_ptr() } #[cfg(any(feature = "v1_16", feature = "dox"))] diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 9ba834529..6a41a1e48 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -107,9 +107,7 @@ impl Structure { pub unsafe fn into_ptr(self) -> *mut gst_sys::GstStructure { let s = mem::ManuallyDrop::new(self); - let ptr = s.0.as_ptr() as *mut StructureRef as *mut gst_sys::GstStructure; - - ptr + s.0.as_ptr() as *mut StructureRef as *mut gst_sys::GstStructure } }