From 3b3c3baee56d5f9ad436e684bee86f78b1631310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 22 Dec 2023 16:26:30 +0200 Subject: [PATCH] Fix / work around a few new clippy 1.75 warnings Part-of: --- examples/src/bin/rtsp-server-custom-auth.rs | 2 +- gstreamer-audio/src/audio_converter.rs | 2 +- gstreamer-editing-services/src/lib.rs | 6 ++++-- gstreamer-gl/egl/src/lib.rs | 1 - gstreamer-gl/wayland/src/lib.rs | 1 - gstreamer-gl/x11/src/lib.rs | 1 - gstreamer-pbutils/src/element_properties.rs | 2 +- gstreamer-rtsp-server/src/lib.rs | 7 +++++-- gstreamer-sdp/src/lib.rs | 1 - gstreamer-utils/src/streamproducer.rs | 2 +- gstreamer-validate/src/lib.rs | 1 - gstreamer-video/src/lib.rs | 1 - gstreamer/src/lib.rs | 2 -- 13 files changed, 13 insertions(+), 16 deletions(-) diff --git a/examples/src/bin/rtsp-server-custom-auth.rs b/examples/src/bin/rtsp-server-custom-auth.rs index 8df20453e..b1af7b9f2 100644 --- a/examples/src/bin/rtsp-server-custom-auth.rs +++ b/examples/src/bin/rtsp-server-custom-auth.rs @@ -134,7 +134,7 @@ mod auth { .request() .expect("Context without request. Should not happen !"); - if let Some(auth_credentials) = req.parse_auth_credentials().get(0) { + if let Some(auth_credentials) = req.parse_auth_credentials().first() { if let Some(authorization) = auth_credentials.authorization() { if let Some(user) = self.external_auth(authorization) { // Update context token with authenticated username diff --git a/gstreamer-audio/src/audio_converter.rs b/gstreamer-audio/src/audio_converter.rs index 247e9070e..d98472b47 100644 --- a/gstreamer-audio/src/audio_converter.rs +++ b/gstreamer-audio/src/audio_converter.rs @@ -130,7 +130,7 @@ impl AudioConverterConfig { } pub fn set_mix_matrix(&mut self, v: &[impl AsRef<[f32]>]) { - let length = v.get(0).map(|v| v.as_ref().len()).unwrap_or(0); + let length = v.first().map(|v| v.as_ref().len()).unwrap_or(0); let array = gst::Array::from_values(v.iter().map(|val| { let val = val.as_ref(); assert_eq!(val.len(), length); diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index cabcb6c76..9aaecadd8 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -67,10 +67,12 @@ mod flag_serde; // Re-export all the traits in a prelude module, so that applications // can always "use ges::prelude::*" without getting conflicts pub mod prelude { - #[doc(hidden)] - pub use gio::prelude::*; #[doc(hidden)] pub use glib::prelude::*; + + #[doc(hidden)] + pub use gio::prelude::*; + #[doc(hidden)] pub use gst_base::prelude::*; #[doc(hidden)] diff --git a/gstreamer-gl/egl/src/lib.rs b/gstreamer-gl/egl/src/lib.rs index 694749717..487f3a07f 100644 --- a/gstreamer-gl/egl/src/lib.rs +++ b/gstreamer-gl/egl/src/lib.rs @@ -24,4 +24,3 @@ mod auto; pub use auto::*; mod gl_display_egl; -pub use gl_display_egl::*; diff --git a/gstreamer-gl/wayland/src/lib.rs b/gstreamer-gl/wayland/src/lib.rs index ff61e7c99..8626d3d36 100644 --- a/gstreamer-gl/wayland/src/lib.rs +++ b/gstreamer-gl/wayland/src/lib.rs @@ -24,4 +24,3 @@ mod auto; pub use auto::*; mod gl_display_wayland; -pub use gl_display_wayland::*; diff --git a/gstreamer-gl/x11/src/lib.rs b/gstreamer-gl/x11/src/lib.rs index 5d4eca9ed..7358eaa08 100644 --- a/gstreamer-gl/x11/src/lib.rs +++ b/gstreamer-gl/x11/src/lib.rs @@ -24,4 +24,3 @@ mod auto; pub use auto::*; mod gl_display_x11; -pub use gl_display_x11::*; diff --git a/gstreamer-pbutils/src/element_properties.rs b/gstreamer-pbutils/src/element_properties.rs index 7cdb28b51..2d4fa6d3f 100644 --- a/gstreamer-pbutils/src/element_properties.rs +++ b/gstreamer-pbutils/src/element_properties.rs @@ -324,6 +324,6 @@ mod test { let list = elem_props.map().unwrap(); assert_eq!(list.len(), 1); - assert_eq!(list.get(0).unwrap(), &props_map); + assert_eq!(list.first().unwrap(), &props_map); } } diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs index 10fe548e8..d39a9273b 100644 --- a/gstreamer-rtsp-server/src/lib.rs +++ b/gstreamer-rtsp-server/src/lib.rs @@ -80,11 +80,14 @@ pub static RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: &glib::GStr = unsafe { pub mod prelude { #[doc(hidden)] pub use gio::prelude::*; - #[doc(hidden)] - pub use gst_net::prelude::*; + #[doc(hidden)] pub use gst_rtsp::prelude::*; + #[allow(unused_imports)] + #[doc(hidden)] + pub use gst_net::prelude::*; + pub use crate::{ auto::traits::*, rtsp_address_pool::RTSPAddressPoolExtManual, rtsp_auth::RTSPAuthExtManual, rtsp_client::RTSPClientExtManual, rtsp_media::RTSPMediaExtManual, diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs index 89df9b7cd..02c2a1d6e 100644 --- a/gstreamer-sdp/src/lib.rs +++ b/gstreamer-sdp/src/lib.rs @@ -21,7 +21,6 @@ macro_rules! skip_assert_initialized { } mod auto; -pub use crate::auto::*; mod sdp_attribute; pub use crate::sdp_attribute::*; diff --git a/gstreamer-utils/src/streamproducer.rs b/gstreamer-utils/src/streamproducer.rs index 1b656f9a9..f93448be2 100644 --- a/gstreamer-utils/src/streamproducer.rs +++ b/gstreamer-utils/src/streamproducer.rs @@ -794,7 +794,7 @@ mod tests { } if i == 5 { - consumers.get(0).unwrap().disconnect(&producer); + consumers.first().unwrap().disconnect(&producer); } } diff --git a/gstreamer-validate/src/lib.rs b/gstreamer-validate/src/lib.rs index 8d91100b0..621b5779c 100644 --- a/gstreamer-validate/src/lib.rs +++ b/gstreamer-validate/src/lib.rs @@ -51,7 +51,6 @@ mod action; pub use action::{Action, ActionRef}; mod reporter; -pub use reporter::*; // Re-export all the traits in a prelude module, so that applications // can always "use gst_validate::prelude::*" without getting conflicts diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 609684901..6780ce188 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -46,7 +46,6 @@ pub use crate::caps_features::{ CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, }; mod video_color_matrix; -pub use video_color_matrix::*; mod video_format; pub use crate::video_format::*; mod video_format_info; diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index ffa4f4660..4af1c13c8 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -46,8 +46,6 @@ pub use crate::auto::*; #[macro_use] #[cfg(feature = "serde")] mod serde_macros; -#[cfg(feature = "serde")] -pub use crate::serde_macros::*; #[macro_use] pub mod log;