From 6913e930cdb4ce3778cb28fe70241faff7518444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 29 Nov 2024 17:34:58 +0200 Subject: [PATCH] Fix / silence new Rust 1.83 clippy warnings Part-of: --- examples/src/bin/custom_meta.rs | 4 +-- examples/src/examples-common.rs | 1 - examples/src/glupload.rs | 20 ++++++------- gstreamer-allocators/src/lib.rs | 1 + gstreamer-analytics/src/classification.rs | 4 +-- gstreamer-analytics/src/lib.rs | 1 + gstreamer-analytics/src/object_detection.rs | 6 ++-- gstreamer-analytics/src/relation_meta.rs | 14 ++++----- gstreamer-analytics/src/tensor.rs | 4 ++- gstreamer-analytics/src/tracking.rs | 8 ++--- gstreamer-app/src/lib.rs | 1 + gstreamer-audio/src/lib.rs | 1 + gstreamer-base/src/adapter.rs | 6 ++-- gstreamer-base/src/base_parse_frame.rs | 8 ++--- gstreamer-base/src/lib.rs | 1 + gstreamer-check/src/harness.rs | 6 ++-- gstreamer-check/src/lib.rs | 1 + gstreamer-controller/src/lib.rs | 1 + gstreamer-editing-services/src/lib.rs | 1 + gstreamer-gl/egl/src/lib.rs | 1 + gstreamer-gl/src/lib.rs | 1 + gstreamer-gl/wayland/src/lib.rs | 1 + gstreamer-gl/x11/src/lib.rs | 1 + gstreamer-mpegts/src/lib.rs | 1 + gstreamer-net/src/lib.rs | 1 + gstreamer-pbutils/src/discoverer.rs | 2 +- .../src/discoverer_audio_info.rs | 2 +- .../src/discoverer_container_info.rs | 2 +- .../src/discoverer_stream_info.rs | 2 +- .../src/discoverer_subtitle_info.rs | 2 +- .../src/discoverer_video_info.rs | 2 +- gstreamer-pbutils/src/functions.rs | 10 +++---- gstreamer-pbutils/src/lib.rs | 1 + gstreamer-play/src/lib.rs | 1 + gstreamer-play/src/play_message.rs | 2 +- gstreamer-player/src/lib.rs | 1 + gstreamer-rtp/src/lib.rs | 1 + gstreamer-rtp/src/rtp_buffer.rs | 14 ++++----- gstreamer-rtsp-server/src/lib.rs | 1 + gstreamer-rtsp/src/lib.rs | 1 + gstreamer-sdp/src/lib.rs | 1 + gstreamer-tag/src/lib.rs | 1 + gstreamer-validate/src/lib.rs | 1 + gstreamer-video/src/lib.rs | 1 + gstreamer-video/src/video_buffer_pool.rs | 2 +- gstreamer-video/src/video_codec_frame.rs | 6 ++-- gstreamer-video/src/video_codec_state.rs | 8 ++--- gstreamer-video/src/video_meta.rs | 2 +- .../src/video_overlay_composition.rs | 8 ++--- gstreamer-video/src/video_rectangle.rs | 2 +- gstreamer-video/src/video_vbi_parser.rs | 2 +- gstreamer-webrtc/src/lib.rs | 1 + gstreamer/src/buffer.rs | 30 +++++++++---------- gstreamer/src/buffer_cursor.rs | 8 ++--- gstreamer/src/bus.rs | 2 +- gstreamer/src/caps.rs | 2 +- gstreamer/src/caps_features.rs | 8 ++--- gstreamer/src/caps_features_serde.rs | 4 +-- gstreamer/src/caps_serde.rs | 6 ++-- gstreamer/src/enums.rs | 2 +- gstreamer/src/format/clock_time.rs | 2 +- gstreamer/src/lib.rs | 1 + gstreamer/src/memory.rs | 28 ++++++++--------- gstreamer/src/meta.rs | 14 ++++----- gstreamer/src/miniobject.rs | 2 +- gstreamer/src/object.rs | 1 - gstreamer/src/pad.rs | 8 ++--- gstreamer/src/pad_template.rs | 1 + gstreamer/src/param_spec.rs | 4 +-- gstreamer/src/slice.rs | 10 +++---- gstreamer/src/stream.rs | 2 +- gstreamer/src/stream_collection.rs | 12 ++++---- gstreamer/src/structure.rs | 26 ++++++++-------- gstreamer/src/structure_serde.rs | 8 ++--- gstreamer/src/subclass/error.rs | 2 +- gstreamer/src/tags.rs | 20 ++++++------- gstreamer/src/tags_serde.rs | 14 ++++----- gstreamer/src/task.rs | 2 +- gstreamer/src/value.rs | 24 +++++++-------- tutorials/src/tutorials-common.rs | 1 - 80 files changed, 222 insertions(+), 196 deletions(-) diff --git a/examples/src/bin/custom_meta.rs b/examples/src/bin/custom_meta.rs index 10f4bd635..933a8e12b 100644 --- a/examples/src/bin/custom_meta.rs +++ b/examples/src/bin/custom_meta.rs @@ -90,7 +90,7 @@ mod custom_meta { *TYPE.get_or_init(|| unsafe { let t = glib::Type::from_glib(gst::ffi::gst_meta_api_type_register( - b"MyCustomMetaAPI\0".as_ptr() as *const _, + c"MyCustomMetaAPI".as_ptr() as *const _, // We provide no tags here as our meta is just a label and does // not refer to any specific aspect of the buffer. [ptr::null::()].as_ptr() as *mut *const _, @@ -163,7 +163,7 @@ mod custom_meta { MetaInfo( ptr::NonNull::new(gst::ffi::gst_meta_register( custom_meta_api_get_type().into_glib(), - b"MyCustomMeta\0".as_ptr() as *const _, + c"MyCustomMeta".as_ptr() as *const _, mem::size_of::(), Some(custom_meta_init), Some(custom_meta_free), diff --git a/examples/src/examples-common.rs b/examples/src/examples-common.rs index aec68ddd0..c751b81aa 100644 --- a/examples/src/examples-common.rs +++ b/examples/src/examples-common.rs @@ -1,7 +1,6 @@ /// macOS has a specific requirement that there must be a run loop running on the main thread in /// order to open windows and use OpenGL, and that the global NSApplication instance must be /// initialized. - /// On macOS this launches the callback function on a thread. /// On other platforms it's just executed immediately. #[cfg(not(target_os = "macos"))] diff --git a/examples/src/glupload.rs b/examples/src/glupload.rs index 0d39f9ace..c56a28d64 100644 --- a/examples/src/glupload.rs +++ b/examples/src/glupload.rs @@ -43,7 +43,7 @@ static IDENTITY: [f32; 16] = [ 0.0, 0.0, 0.0, 1.0, ]; -const VS_SRC: &[u8] = b" +const VS_SRC: &[u8] = c" uniform mat4 u_transformation; attribute vec4 a_position; attribute vec2 a_texcoord; @@ -52,10 +52,10 @@ varying vec2 v_texcoord; void main() { gl_Position = u_transformation * a_position; v_texcoord = a_texcoord; -} -\0"; +}" +.to_bytes(); -const FS_SRC: &[u8] = b" +const FS_SRC: &[u8] = c" #ifdef GL_ES precision mediump float; #endif @@ -64,8 +64,8 @@ uniform sampler2D tex; void main() { gl_FragColor = texture2D(tex, v_texcoord); -} -\0"; +}" +.to_bytes(); #[allow(clippy::unreadable_literal)] #[allow(clippy::unused_unit)] @@ -149,12 +149,12 @@ impl Gl { let location = self .gl - .GetUniformLocation(self.program, b"tex\0".as_ptr() as *const _); + .GetUniformLocation(self.program, c"tex".as_ptr() as *const _); self.gl.Uniform1i(location, 0); let location = self .gl - .GetUniformLocation(self.program, b"u_transformation\0".as_ptr() as *const _); + .GetUniformLocation(self.program, c"u_transformation".as_ptr() as *const _); self.gl .UniformMatrix4fv(location, 1, gl::FALSE, IDENTITY.as_ptr() as *const _); @@ -222,8 +222,8 @@ fn load(gl_display: &impl glutin::display::GlDisplay) -> Gl { assert_eq!(gl.GetError(), 0); } - let attr_position = gl.GetAttribLocation(program, b"a_position\0".as_ptr() as *const _); - let attr_texture = gl.GetAttribLocation(program, b"a_texcoord\0".as_ptr() as *const _); + let attr_position = gl.GetAttribLocation(program, c"a_position".as_ptr() as *const _); + let attr_texture = gl.GetAttribLocation(program, c"a_texcoord".as_ptr() as *const _); let vao = if gl.BindVertexArray.is_loaded() { let mut vao = mem::MaybeUninit::uninit(); diff --git a/gstreamer-allocators/src/lib.rs b/gstreamer-allocators/src/lib.rs index 3235e7c2e..b5616403b 100644 --- a/gstreamer-allocators/src/lib.rs +++ b/gstreamer-allocators/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-analytics/src/classification.rs b/gstreamer-analytics/src/classification.rs index 7875bda70..1f95e0b52 100644 --- a/gstreamer-analytics/src/classification.rs +++ b/gstreamer-analytics/src/classification.rs @@ -91,7 +91,7 @@ unsafe fn from(t: ffi::GstAnalyticsMtd) -> ffi::GstAnalyticsClsMtd { std::mem::transmute(t) } -impl<'a> AnalyticsMtdRef<'a, AnalyticsClassificationMtd> { +impl AnalyticsMtdRef<'_, AnalyticsClassificationMtd> { #[doc(alias = "gst_analytics_cls_mtd_get_length")] pub fn len(&self) -> usize { unsafe { @@ -139,7 +139,7 @@ pub struct AnalyticsClassificationIterator<'a> { length: usize, } -impl<'a> Iterator for AnalyticsClassificationIterator<'a> { +impl Iterator for AnalyticsClassificationIterator<'_> { type Item = (glib::Quark, f32); fn next(&mut self) -> Option { diff --git a/gstreamer-analytics/src/lib.rs b/gstreamer-analytics/src/lib.rs index 03eeac761..6b0841f2d 100644 --- a/gstreamer-analytics/src/lib.rs +++ b/gstreamer-analytics/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-analytics/src/object_detection.rs b/gstreamer-analytics/src/object_detection.rs index e20184b3c..2428129cc 100644 --- a/gstreamer-analytics/src/object_detection.rs +++ b/gstreamer-analytics/src/object_detection.rs @@ -24,8 +24,8 @@ pub trait AnalyticsRelationMetaODExt: sealed::Sealed { ) -> Result, glib::BoolError>; } -impl<'a> AnalyticsRelationMetaODExt - for gst::MetaRefMut<'a, AnalyticsRelationMeta, gst::meta::Standalone> +impl AnalyticsRelationMetaODExt + for gst::MetaRefMut<'_, AnalyticsRelationMeta, gst::meta::Standalone> { #[doc(alias = "gst_analytics_relation_meta_add_od_mtd")] fn add_od_mtd( @@ -80,7 +80,7 @@ unsafe fn from(t: ffi::GstAnalyticsMtd) -> ffi::GstAnalyticsODMtd { std::mem::transmute(t) } -impl<'a> AnalyticsMtdRef<'a, AnalyticsODMtd> { +impl AnalyticsMtdRef<'_, AnalyticsODMtd> { #[doc(alias = "gst_analytics_od_mtd_get_obj_type")] pub fn obj_type(&self) -> Option { unsafe { diff --git a/gstreamer-analytics/src/relation_meta.rs b/gstreamer-analytics/src/relation_meta.rs index 45d482a2a..2b619960f 100644 --- a/gstreamer-analytics/src/relation_meta.rs +++ b/gstreamer-analytics/src/relation_meta.rs @@ -225,12 +225,12 @@ mod sealed { pub trait AnalyticsMetaRefExt<'a>: sealed::Sealed { #[doc(alias = "gst_analytics_relation_meta_get_mtd")] fn mtd(&self, an_meta_id: u32) -> Option>; - fn iter(&'a self) -> AnalyticsMtdIter; + fn iter(&'a self) -> AnalyticsMtdIter<'a, T>; fn iter_direct_related( &'a self, an_meta_id: u32, rel_type: RelTypes, - ) -> AnalyticsMtdIter; + ) -> AnalyticsMtdIter<'a, T>; } impl<'a> AnalyticsMetaRefExt<'a> for gst::MetaRef<'a, AnalyticsRelationMeta> { @@ -260,7 +260,7 @@ impl<'a> AnalyticsMetaRefExt<'a> for gst::MetaRef<'a, AnalyticsRelationMeta> { &'a self, an_meta_id: u32, rel_type: RelTypes, - ) -> AnalyticsMtdIter { + ) -> AnalyticsMtdIter<'a, T> { AnalyticsMtdIter::new_direct_related(self, an_meta_id, rel_type.into_glib()) } } @@ -339,12 +339,12 @@ pub trait AnalyticsMetaRefMutExt<'a>: sealed::Sealed { fn mtd_mut(&'a mut self, an_meta_id: u32) -> Option>; - fn iter_mut(&'a mut self) -> AnalyticsMtdIterMut; + fn iter_mut(&'a mut self) -> AnalyticsMtdIterMut<'a, T>; fn iter_direct_related_mut( &'a mut self, an_meta_id: u32, rel_type: RelTypes, - ) -> AnalyticsMtdIterMut; + ) -> AnalyticsMtdIterMut<'a, T>; } impl<'a> AnalyticsMetaRefMutExt<'a> @@ -372,14 +372,14 @@ impl<'a> AnalyticsMetaRefMutExt<'a> } } - fn iter_mut(&'a mut self) -> AnalyticsMtdIterMut { + fn iter_mut(&'a mut self) -> AnalyticsMtdIterMut<'a, T> { AnalyticsMtdIterMut::new(self) } fn iter_direct_related_mut( &'a mut self, an_meta_id: u32, rel_type: RelTypes, - ) -> AnalyticsMtdIterMut { + ) -> AnalyticsMtdIterMut<'a, T> { AnalyticsMtdIterMut::new_direct_related(self, an_meta_id, rel_type.into_glib()) } } diff --git a/gstreamer-analytics/src/tensor.rs b/gstreamer-analytics/src/tensor.rs index 5dc1758f8..9c7597430 100644 --- a/gstreamer-analytics/src/tensor.rs +++ b/gstreamer-analytics/src/tensor.rs @@ -17,7 +17,9 @@ impl<'a> glib::translate::ToGlibPtrMut<'a, *mut ffi::GstTensorDim> for TensorDim type Storage = PhantomData<&'a mut Self>; #[inline] - fn to_glib_none_mut(&'a mut self) -> glib::translate::StashMut<*mut ffi::GstTensorDim, Self> { + fn to_glib_none_mut( + &'a mut self, + ) -> glib::translate::StashMut<'a, *mut ffi::GstTensorDim, Self> { glib::translate::StashMut(self as *mut _ as *mut _, PhantomData) } } diff --git a/gstreamer-analytics/src/tracking.rs b/gstreamer-analytics/src/tracking.rs index 1e7ee0faf..f7ae50e1d 100644 --- a/gstreamer-analytics/src/tracking.rs +++ b/gstreamer-analytics/src/tracking.rs @@ -20,8 +20,8 @@ pub trait AnalyticsRelationMetaTrackingExt: sealed::Sealed { ) -> Result, glib::BoolError>; } -impl<'a> AnalyticsRelationMetaTrackingExt - for gst::MetaRefMut<'a, AnalyticsRelationMeta, gst::meta::Standalone> +impl AnalyticsRelationMetaTrackingExt + for gst::MetaRefMut<'_, AnalyticsRelationMeta, gst::meta::Standalone> { #[doc(alias = "gst_analytics_relation_meta_add_tracking_mtd")] fn add_tracking_mtd( @@ -59,7 +59,7 @@ unsafe fn from(t: ffi::GstAnalyticsMtd) -> ffi::GstAnalyticsTrackingMtd { std::mem::transmute(t) } -impl<'a> AnalyticsMtdRef<'a, AnalyticsTrackingMtd> { +impl AnalyticsMtdRef<'_, AnalyticsTrackingMtd> { #[doc(alias = "gst_analytics_tracking_mtd_get_info")] pub fn info(&self) -> (u64, gst::ClockTime, gst::ClockTime, bool) { let mut tracking_id: u64 = 0; @@ -87,7 +87,7 @@ impl<'a> AnalyticsMtdRef<'a, AnalyticsTrackingMtd> { } } -impl<'a> AnalyticsMtdRefMut<'a, AnalyticsTrackingMtd> { +impl AnalyticsMtdRefMut<'_, AnalyticsTrackingMtd> { #[doc(alias = "gst_analytics_tracking_mtd_update_last_seen")] pub fn update_last_seen(&mut self, last_seen: gst::ClockTime) -> Result<(), glib::BoolError> { let ret: bool = unsafe { diff --git a/gstreamer-app/src/lib.rs b/gstreamer-app/src/lib.rs index ae1e0765a..922d57d52 100644 --- a/gstreamer-app/src/lib.rs +++ b/gstreamer-app/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index ca995847f..929e5e688 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-base/src/adapter.rs b/gstreamer-base/src/adapter.rs index 1fbc7d584..6a4bcfb50 100644 --- a/gstreamer-base/src/adapter.rs +++ b/gstreamer-base/src/adapter.rs @@ -422,7 +422,7 @@ impl UniqueAdapter { #[derive(Debug)] pub struct UniqueAdapterMap<'a>(&'a UniqueAdapter, &'a [u8]); -impl<'a> Drop for UniqueAdapterMap<'a> { +impl Drop for UniqueAdapterMap<'_> { #[inline] fn drop(&mut self) { unsafe { @@ -431,7 +431,7 @@ impl<'a> Drop for UniqueAdapterMap<'a> { } } -impl<'a> ops::Deref for UniqueAdapterMap<'a> { +impl ops::Deref for UniqueAdapterMap<'_> { type Target = [u8]; #[inline] @@ -440,7 +440,7 @@ impl<'a> ops::Deref for UniqueAdapterMap<'a> { } } -impl<'a> AsRef<[u8]> for UniqueAdapterMap<'a> { +impl AsRef<[u8]> for UniqueAdapterMap<'_> { #[inline] fn as_ref(&self) -> &[u8] { self.1 diff --git a/gstreamer-base/src/base_parse_frame.rs b/gstreamer-base/src/base_parse_frame.rs index f9c5032ad..cf2f29567 100644 --- a/gstreamer-base/src/base_parse_frame.rs +++ b/gstreamer-base/src/base_parse_frame.rs @@ -11,8 +11,8 @@ pub struct BaseParseFrame<'a>( PhantomData<&'a BaseParse>, ); -unsafe impl<'a> Send for BaseParseFrame<'a> {} -unsafe impl<'a> Sync for BaseParseFrame<'a> {} +unsafe impl Send for BaseParseFrame<'_> {} +unsafe impl Sync for BaseParseFrame<'_> {} #[derive(Debug)] pub enum Overhead { @@ -53,7 +53,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstBaseParseFrame> for BaseP type Storage = PhantomData<&'a Self>; #[inline] - fn to_glib_none(&'a self) -> ::glib::translate::Stash<*mut ffi::GstBaseParseFrame, Self> { + fn to_glib_none(&'a self) -> ::glib::translate::Stash<'a, *mut ffi::GstBaseParseFrame, Self> { Stash(self.0.as_ptr(), PhantomData) } @@ -62,7 +62,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstBaseParseFrame> for BaseP } } -impl<'a> fmt::Debug for BaseParseFrame<'a> { +impl fmt::Debug for BaseParseFrame<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut b = f.debug_struct("BaseParseFrame"); diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index 9c3572d50..1762f395f 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index ec8331cb9..1d221c520 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -813,7 +813,7 @@ impl Harness { #[derive(Debug)] pub struct Ref<'a>(&'a Harness); -impl<'a> ops::Deref for Ref<'a> { +impl ops::Deref for Ref<'_> { type Target = Harness; #[inline] @@ -825,7 +825,7 @@ impl<'a> ops::Deref for Ref<'a> { #[derive(Debug)] pub struct RefMut<'a>(&'a mut Harness); -impl<'a> ops::Deref for RefMut<'a> { +impl ops::Deref for RefMut<'_> { type Target = Harness; #[inline] @@ -834,7 +834,7 @@ impl<'a> ops::Deref for RefMut<'a> { } } -impl<'a> ops::DerefMut for RefMut<'a> { +impl ops::DerefMut for RefMut<'_> { #[inline] fn deref_mut(&mut self) -> &mut Harness { self.0 diff --git a/gstreamer-check/src/lib.rs b/gstreamer-check/src/lib.rs index cfe268fc2..20ec298df 100644 --- a/gstreamer-check/src/lib.rs +++ b/gstreamer-check/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-controller/src/lib.rs b/gstreamer-controller/src/lib.rs index 7caf866f5..1ff239435 100644 --- a/gstreamer-controller/src/lib.rs +++ b/gstreamer-controller/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index 5015ecc84..b01b15085 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] use std::sync::Once; diff --git a/gstreamer-gl/egl/src/lib.rs b/gstreamer-gl/egl/src/lib.rs index d39dabdea..abfc35c76 100644 --- a/gstreamer-gl/egl/src/lib.rs +++ b/gstreamer-gl/egl/src/lib.rs @@ -8,6 +8,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] pub use gst_gl; pub use gstreamer_gl_egl_sys as ffi; diff --git a/gstreamer-gl/src/lib.rs b/gstreamer-gl/src/lib.rs index 62ae45bd3..fa6e3bd18 100644 --- a/gstreamer-gl/src/lib.rs +++ b/gstreamer-gl/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-gl/wayland/src/lib.rs b/gstreamer-gl/wayland/src/lib.rs index 05d0156a2..db515e674 100644 --- a/gstreamer-gl/wayland/src/lib.rs +++ b/gstreamer-gl/wayland/src/lib.rs @@ -8,6 +8,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] pub use gst_gl; pub use gstreamer_gl_wayland_sys as ffi; diff --git a/gstreamer-gl/x11/src/lib.rs b/gstreamer-gl/x11/src/lib.rs index 0aad0c700..4ed9bb489 100644 --- a/gstreamer-gl/x11/src/lib.rs +++ b/gstreamer-gl/x11/src/lib.rs @@ -8,6 +8,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] pub use gst_gl; pub use gstreamer_gl_x11_sys as ffi; diff --git a/gstreamer-mpegts/src/lib.rs b/gstreamer-mpegts/src/lib.rs index bfb8b4159..c751cf354 100644 --- a/gstreamer-mpegts/src/lib.rs +++ b/gstreamer-mpegts/src/lib.rs @@ -1,5 +1,6 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] use std::sync::Once; diff --git a/gstreamer-net/src/lib.rs b/gstreamer-net/src/lib.rs index 43ea33bfa..beb818244 100644 --- a/gstreamer-net/src/lib.rs +++ b/gstreamer-net/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gio; diff --git a/gstreamer-pbutils/src/discoverer.rs b/gstreamer-pbutils/src/discoverer.rs index c0aa5b419..c3b9c537c 100644 --- a/gstreamer-pbutils/src/discoverer.rs +++ b/gstreamer-pbutils/src/discoverer.rs @@ -51,7 +51,7 @@ unsafe extern "C" fn notify_timeout_trampoline(&'a DiscovererInfo); -impl<'a> fmt::Debug for DebugInfo<'a> { +impl fmt::Debug for DebugInfo<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let stream_info = self.0.stream_info(); let stream_list = self.0.stream_list(); diff --git a/gstreamer-pbutils/src/discoverer_audio_info.rs b/gstreamer-pbutils/src/discoverer_audio_info.rs index 7ea238de3..aa7074de9 100644 --- a/gstreamer-pbutils/src/discoverer_audio_info.rs +++ b/gstreamer-pbutils/src/discoverer_audio_info.rs @@ -8,7 +8,7 @@ use crate::{DiscovererAudioInfo, DiscovererStreamInfo}; pub struct Debug<'a>(&'a DiscovererAudioInfo); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let info = self.0.upcast_ref::(); diff --git a/gstreamer-pbutils/src/discoverer_container_info.rs b/gstreamer-pbutils/src/discoverer_container_info.rs index d897f3326..651164c2d 100644 --- a/gstreamer-pbutils/src/discoverer_container_info.rs +++ b/gstreamer-pbutils/src/discoverer_container_info.rs @@ -5,7 +5,7 @@ use crate::{prelude::*, DiscovererContainerInfo}; pub struct Debug<'a>(&'a DiscovererContainerInfo); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let streams = self.0.streams(); diff --git a/gstreamer-pbutils/src/discoverer_stream_info.rs b/gstreamer-pbutils/src/discoverer_stream_info.rs index fb4c6ba0a..79f0646e7 100644 --- a/gstreamer-pbutils/src/discoverer_stream_info.rs +++ b/gstreamer-pbutils/src/discoverer_stream_info.rs @@ -51,7 +51,7 @@ impl> DiscovererStreamInfoExtManual for O {} pub struct Debug<'a>(&'a DiscovererStreamInfo); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut d = f.debug_struct("DiscovererStreamInfo"); d.field("caps", &self.0.caps()) diff --git a/gstreamer-pbutils/src/discoverer_subtitle_info.rs b/gstreamer-pbutils/src/discoverer_subtitle_info.rs index 7f6f1efca..adfed5cc8 100644 --- a/gstreamer-pbutils/src/discoverer_subtitle_info.rs +++ b/gstreamer-pbutils/src/discoverer_subtitle_info.rs @@ -8,7 +8,7 @@ use crate::{DiscovererStreamInfo, DiscovererSubtitleInfo}; pub struct Debug<'a>(&'a DiscovererSubtitleInfo); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let info = self.0.upcast_ref::(); diff --git a/gstreamer-pbutils/src/discoverer_video_info.rs b/gstreamer-pbutils/src/discoverer_video_info.rs index b6323231c..770751750 100644 --- a/gstreamer-pbutils/src/discoverer_video_info.rs +++ b/gstreamer-pbutils/src/discoverer_video_info.rs @@ -38,7 +38,7 @@ impl DiscovererVideoInfo { pub struct Debug<'a>(&'a DiscovererVideoInfo); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let info = self.0.upcast_ref::(); diff --git a/gstreamer-pbutils/src/functions.rs b/gstreamer-pbutils/src/functions.rs index 68d600f8c..07793330b 100644 --- a/gstreamer-pbutils/src/functions.rs +++ b/gstreamer-pbutils/src/functions.rs @@ -8,11 +8,11 @@ use glib::translate::*; pub unsafe trait CodecTag<'a>: gst::Tag<'a, TagType = &'a str> {} -unsafe impl<'a> CodecTag<'a> for gst::tags::ContainerFormat {} -unsafe impl<'a> CodecTag<'a> for gst::tags::AudioCodec {} -unsafe impl<'a> CodecTag<'a> for gst::tags::VideoCodec {} -unsafe impl<'a> CodecTag<'a> for gst::tags::SubtitleCodec {} -unsafe impl<'a> CodecTag<'a> for gst::tags::Codec {} +unsafe impl CodecTag<'_> for gst::tags::ContainerFormat {} +unsafe impl CodecTag<'_> for gst::tags::AudioCodec {} +unsafe impl CodecTag<'_> for gst::tags::VideoCodec {} +unsafe impl CodecTag<'_> for gst::tags::SubtitleCodec {} +unsafe impl CodecTag<'_> for gst::tags::Codec {} pub fn pb_utils_add_codec_description_to_tag_list_for_tag<'a, T: CodecTag<'a>>( taglist: &mut gst::TagListRef, diff --git a/gstreamer-pbutils/src/lib.rs b/gstreamer-pbutils/src/lib.rs index eda876360..ed665cfd0 100644 --- a/gstreamer-pbutils/src/lib.rs +++ b/gstreamer-pbutils/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] use std::sync::Once; diff --git a/gstreamer-play/src/lib.rs b/gstreamer-play/src/lib.rs index 7c136959d..54aab3cb6 100644 --- a/gstreamer-play/src/lib.rs +++ b/gstreamer-play/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gst; diff --git a/gstreamer-play/src/play_message.rs b/gstreamer-play/src/play_message.rs index 3b547df2e..a3c18f2d5 100644 --- a/gstreamer-play/src/play_message.rs +++ b/gstreamer-play/src/play_message.rs @@ -339,7 +339,7 @@ impl std::fmt::Debug for Other { } } -impl<'a> PlayMessage<'a> { +impl PlayMessage<'_> { #[doc(alias = "gst_play_message_parse_uri_loaded")] #[doc(alias = "gst_play_message_parse_position_updated")] #[doc(alias = "gst_play_message_parse_duration_updated")] diff --git a/gstreamer-player/src/lib.rs b/gstreamer-player/src/lib.rs index 483c64844..457150598 100644 --- a/gstreamer-player/src/lib.rs +++ b/gstreamer-player/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gst; diff --git a/gstreamer-rtp/src/lib.rs b/gstreamer-rtp/src/lib.rs index 0c715fa9d..57861d4fb 100644 --- a/gstreamer-rtp/src/lib.rs +++ b/gstreamer-rtp/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-rtp/src/rtp_buffer.rs b/gstreamer-rtp/src/rtp_buffer.rs index 7b3a88032..93e5a3977 100644 --- a/gstreamer-rtp/src/rtp_buffer.rs +++ b/gstreamer-rtp/src/rtp_buffer.rs @@ -13,10 +13,10 @@ pub struct RTPBuffer<'a, T> { phantom: PhantomData<&'a T>, } -unsafe impl<'a, T> Send for RTPBuffer<'a, T> {} -unsafe impl<'a, T> Sync for RTPBuffer<'a, T> {} +unsafe impl Send for RTPBuffer<'_, T> {} +unsafe impl Sync for RTPBuffer<'_, T> {} -impl<'a, T> fmt::Debug for RTPBuffer<'a, T> { +impl fmt::Debug for RTPBuffer<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("RTPBuffer") .field("rtp_buffer", &self.rtp_buffer) @@ -28,7 +28,7 @@ impl<'a> RTPBuffer<'a, Readable> { #[inline] pub fn from_buffer_readable( buffer: &'a gst::BufferRef, - ) -> Result, glib::BoolError> { + ) -> Result, glib::BoolError> { skip_assert_initialized!(); unsafe { let mut rtp_buffer = mem::MaybeUninit::zeroed(); @@ -64,7 +64,7 @@ impl<'a> RTPBuffer<'a, Writable> { #[inline] pub fn from_buffer_writable( buffer: &'a mut gst::BufferRef, - ) -> Result, glib::BoolError> { + ) -> Result, glib::BoolError> { skip_assert_initialized!(); unsafe { let mut rtp_buffer = mem::MaybeUninit::zeroed(); @@ -202,7 +202,7 @@ impl<'a> RTPBuffer<'a, Writable> { } } -impl<'a, T> RTPBuffer<'a, T> { +impl RTPBuffer<'_, T> { #[doc(alias = "get_seq")] #[doc(alias = "gst_rtp_buffer_get_seq")] pub fn seq(&self) -> u16 { @@ -429,7 +429,7 @@ impl<'a, T> RTPBuffer<'a, T> { } } -impl<'a, T> Drop for RTPBuffer<'a, T> { +impl Drop for RTPBuffer<'_, T> { #[inline] fn drop(&mut self) { unsafe { diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs index a3b0aa16c..a766074ac 100644 --- a/gstreamer-rtsp-server/src/lib.rs +++ b/gstreamer-rtsp-server/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gio; diff --git a/gstreamer-rtsp/src/lib.rs b/gstreamer-rtsp/src/lib.rs index 25fea9ce4..2f2cfeddb 100644 --- a/gstreamer-rtsp/src/lib.rs +++ b/gstreamer-rtsp/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs index 277718a19..5be7c5646 100644 --- a/gstreamer-sdp/src/lib.rs +++ b/gstreamer-sdp/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-tag/src/lib.rs b/gstreamer-tag/src/lib.rs index cf2a2466c..bc4f1b452 100644 --- a/gstreamer-tag/src/lib.rs +++ b/gstreamer-tag/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-validate/src/lib.rs b/gstreamer-validate/src/lib.rs index 53b35a3e5..ec784f6c7 100644 --- a/gstreamer-validate/src/lib.rs +++ b/gstreamer-validate/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use gstreamer_validate_sys as ffi; diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 2afe21f54..1edd6fa39 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer-video/src/video_buffer_pool.rs b/gstreamer-video/src/video_buffer_pool.rs index 0ca0cc6cd..1da6c786c 100644 --- a/gstreamer-video/src/video_buffer_pool.rs +++ b/gstreamer-video/src/video_buffer_pool.rs @@ -91,7 +91,7 @@ impl<'a> ToGlibPtr<'a, *const ffi::GstVideoAlignment> for VideoAlignment { type Storage = PhantomData<&'a Self>; #[inline] - fn to_glib_none(&'a self) -> Stash<*const ffi::GstVideoAlignment, Self> { + fn to_glib_none(&'a self) -> Stash<'a, *const ffi::GstVideoAlignment, Self> { Stash(&self.0, PhantomData) } } diff --git a/gstreamer-video/src/video_codec_frame.rs b/gstreamer-video/src/video_codec_frame.rs index 47de4483c..f34dc583c 100644 --- a/gstreamer-video/src/video_codec_frame.rs +++ b/gstreamer-video/src/video_codec_frame.rs @@ -28,7 +28,7 @@ impl<'a> ::glib::translate::ToGlibPtr<'a, *mut ffi::GstVideoCodecFrame> for Vide } } -impl<'a> fmt::Debug for VideoCodecFrame<'a> { +impl fmt::Debug for VideoCodecFrame<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut b = f.debug_struct("VideoCodecFrame"); @@ -235,7 +235,7 @@ impl<'a> VideoCodecFrame<'a> { } } -impl<'a> IntoGlibPtr<*mut ffi::GstVideoCodecFrame> for VideoCodecFrame<'a> { +impl IntoGlibPtr<*mut ffi::GstVideoCodecFrame> for VideoCodecFrame<'_> { #[inline] unsafe fn into_glib_ptr(self) -> *mut ffi::GstVideoCodecFrame { let stream_lock = self.element.stream_lock(); @@ -246,7 +246,7 @@ impl<'a> IntoGlibPtr<*mut ffi::GstVideoCodecFrame> for VideoCodecFrame<'a> { } } -impl<'a> Drop for VideoCodecFrame<'a> { +impl Drop for VideoCodecFrame<'_> { #[inline] fn drop(&mut self) { unsafe { diff --git a/gstreamer-video/src/video_codec_state.rs b/gstreamer-video/src/video_codec_state.rs index 078746e59..b0e9cc30c 100644 --- a/gstreamer-video/src/video_codec_state.rs +++ b/gstreamer-video/src/video_codec_state.rs @@ -61,7 +61,7 @@ impl<'a, T: VideoCodecStateContext<'a>> fmt::Debug for VideoCodecState<'a, T> { } } -impl<'a> VideoCodecState<'a, Readable> { +impl VideoCodecState<'_, Readable> { // Take ownership of @state #[inline] pub(crate) unsafe fn new(state: *mut ffi::GstVideoCodecState) -> Self { @@ -238,7 +238,7 @@ impl<'a> VideoCodecState<'a, InNegotiation<'a>> { } } -impl<'a> Clone for VideoCodecState<'a, Readable> { +impl Clone for VideoCodecState<'_, Readable> { #[inline] fn clone(&self) -> Self { unsafe { @@ -248,5 +248,5 @@ impl<'a> Clone for VideoCodecState<'a, Readable> { } } -unsafe impl<'a> Send for VideoCodecState<'a, Readable> {} -unsafe impl<'a> Sync for VideoCodecState<'a, Readable> {} +unsafe impl Send for VideoCodecState<'_, Readable> {} +unsafe impl Sync for VideoCodecState<'_, Readable> {} diff --git a/gstreamer-video/src/video_meta.rs b/gstreamer-video/src/video_meta.rs index a98dffced..5187414c2 100644 --- a/gstreamer-video/src/video_meta.rs +++ b/gstreamer-video/src/video_meta.rs @@ -431,7 +431,7 @@ impl<'a> Iterator for ParamsIter<'a> { } } -impl<'a> std::iter::FusedIterator for ParamsIter<'a> {} +impl std::iter::FusedIterator for ParamsIter<'_> {} unsafe impl MetaAPI for VideoRegionOfInterestMeta { type GstType = ffi::GstVideoRegionOfInterestMeta; diff --git a/gstreamer-video/src/video_overlay_composition.rs b/gstreamer-video/src/video_overlay_composition.rs index b6ab51dd6..4fb764f93 100644 --- a/gstreamer-video/src/video_overlay_composition.rs +++ b/gstreamer-video/src/video_overlay_composition.rs @@ -460,7 +460,7 @@ pub struct Iter<'a> { len: usize, } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = VideoOverlayRectangle; fn next(&mut self) -> Option { @@ -504,7 +504,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.len { return None; @@ -527,6 +527,6 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> std::iter::FusedIterator for Iter<'a> {} +impl std::iter::FusedIterator for Iter<'_> {} diff --git a/gstreamer-video/src/video_rectangle.rs b/gstreamer-video/src/video_rectangle.rs index 84125e704..8482663d1 100644 --- a/gstreamer-video/src/video_rectangle.rs +++ b/gstreamer-video/src/video_rectangle.rs @@ -67,7 +67,7 @@ impl<'a> glib::translate::ToGlibPtrMut<'a, *mut ffi::GstVideoRectangle> for Vide #[inline] fn to_glib_none_mut( &'a mut self, - ) -> glib::translate::StashMut<*mut ffi::GstVideoRectangle, Self> { + ) -> glib::translate::StashMut<'a, *mut ffi::GstVideoRectangle, Self> { glib::translate::StashMut(self as *mut _ as *mut _, PhantomData) } } diff --git a/gstreamer-video/src/video_vbi_parser.rs b/gstreamer-video/src/video_vbi_parser.rs index f47b5ff1c..0a916662a 100644 --- a/gstreamer-video/src/video_vbi_parser.rs +++ b/gstreamer-video/src/video_vbi_parser.rs @@ -157,7 +157,7 @@ pub struct AncillaryIter<'a> { parser: &'a mut VideoVBIParser, } -impl<'a> Iterator for AncillaryIter<'a> { +impl Iterator for AncillaryIter<'_> { type Item = Result; fn next(&mut self) -> Option { diff --git a/gstreamer-webrtc/src/lib.rs b/gstreamer-webrtc/src/lib.rs index 9398c0b24..283bd64b8 100644 --- a/gstreamer-webrtc/src/lib.rs +++ b/gstreamer-webrtc/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] pub use glib; diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index b2ddbc4bc..0907f1dc4 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -1238,7 +1238,7 @@ impl PartialEq for BufferRef { impl Eq for BufferRef {} -impl<'a, T> BufferMap<'a, T> { +impl BufferMap<'_, T> { #[doc(alias = "get_size")] #[inline] pub fn size(&self) -> usize { @@ -1260,7 +1260,7 @@ impl<'a, T> BufferMap<'a, T> { } } -impl<'a> BufferMap<'a, Writable> { +impl BufferMap<'_, Writable> { #[inline] pub fn as_mut_slice(&mut self) -> &mut [u8] { if self.map_info.size == 0 { @@ -1270,21 +1270,21 @@ impl<'a> BufferMap<'a, Writable> { } } -impl<'a, T> AsRef<[u8]> for BufferMap<'a, T> { +impl AsRef<[u8]> for BufferMap<'_, T> { #[inline] fn as_ref(&self) -> &[u8] { self.as_slice() } } -impl<'a> AsMut<[u8]> for BufferMap<'a, Writable> { +impl AsMut<[u8]> for BufferMap<'_, Writable> { #[inline] fn as_mut(&mut self) -> &mut [u8] { self.as_mut_slice() } } -impl<'a, T> ops::Deref for BufferMap<'a, T> { +impl ops::Deref for BufferMap<'_, T> { type Target = [u8]; #[inline] @@ -1293,14 +1293,14 @@ impl<'a, T> ops::Deref for BufferMap<'a, T> { } } -impl<'a> ops::DerefMut for BufferMap<'a, Writable> { +impl ops::DerefMut for BufferMap<'_, Writable> { #[inline] fn deref_mut(&mut self) -> &mut [u8] { self.as_mut_slice() } } -impl<'a, T> fmt::Debug for BufferMap<'a, T> { +impl fmt::Debug for BufferMap<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("BufferMap").field(&self.buffer()).finish() } @@ -1312,9 +1312,9 @@ impl<'a, T> PartialEq for BufferMap<'a, T> { } } -impl<'a, T> Eq for BufferMap<'a, T> {} +impl Eq for BufferMap<'_, T> {} -impl<'a, T> Drop for BufferMap<'a, T> { +impl Drop for BufferMap<'_, T> { #[inline] fn drop(&mut self) { unsafe { @@ -1323,8 +1323,8 @@ impl<'a, T> Drop for BufferMap<'a, T> { } } -unsafe impl<'a, T> Send for BufferMap<'a, T> {} -unsafe impl<'a, T> Sync for BufferMap<'a, T> {} +unsafe impl Send for BufferMap<'_, T> {} +unsafe impl Sync for BufferMap<'_, T> {} impl MappedBuffer { #[inline] @@ -1455,7 +1455,7 @@ struct BufferChunked16Iter<'a> { len: usize, } -impl<'a> Iterator for BufferChunked16Iter<'a> { +impl Iterator for BufferChunked16Iter<'_> { // FIXME: Return a `&'self [u8]` once there's some GAT iterator trait type Item = ([u8; 16], usize); @@ -1493,7 +1493,7 @@ impl<'a> Iterator for BufferChunked16Iter<'a> { } } -impl<'a> Dump<'a> { +impl Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter, debug: bool) -> fmt::Result { let n_memory = self.buffer.n_memory(); if n_memory == 0 { @@ -1617,13 +1617,13 @@ impl<'a> Dump<'a> { } } -impl<'a> fmt::Display for Dump<'a> { +impl fmt::Display for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.fmt(f, false) } } -impl<'a> fmt::Debug for Dump<'a> { +impl fmt::Debug for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt(f, true) } diff --git a/gstreamer/src/buffer_cursor.rs b/gstreamer/src/buffer_cursor.rs index 132fdfd61..94c40f305 100644 --- a/gstreamer/src/buffer_cursor.rs +++ b/gstreamer/src/buffer_cursor.rs @@ -343,19 +343,19 @@ impl Drop for BufferRefCursor { } } -impl<'a> io::Read for BufferRefCursor<&'a BufferRef> { +impl io::Read for BufferRefCursor<&BufferRef> { define_read_impl!(|s| s.buffer); } -impl<'a> io::Write for BufferRefCursor<&'a mut BufferRef> { +impl io::Write for BufferRefCursor<&mut BufferRef> { define_write_impl!(|s| s.buffer); } -impl<'a> io::Seek for BufferRefCursor<&'a BufferRef> { +impl io::Seek for BufferRefCursor<&BufferRef> { define_seek_impl!(|s| s.buffer); } -impl<'a> io::Seek for BufferRefCursor<&'a mut BufferRef> { +impl io::Seek for BufferRefCursor<&mut BufferRef> { define_seek_impl!(|s| s.buffer); } diff --git a/gstreamer/src/bus.rs b/gstreamer/src/bus.rs index c0eb90d8e..09c411b78 100644 --- a/gstreamer/src/bus.rs +++ b/gstreamer/src/bus.rs @@ -326,7 +326,7 @@ pub struct Iter<'a> { timeout: Option, } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = Message; fn next(&mut self) -> Option { diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index 0d589975d..77f24a6f0 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -1308,7 +1308,7 @@ impl fmt::Debug for CapsRef { structure: &'a StructureRef, } - impl<'a> fmt::Debug for WithFeatures<'a> { + impl fmt::Debug for WithFeatures<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let name = format!("{}({})", self.structure.name(), self.features); let mut debug = f.debug_struct(&name); diff --git a/gstreamer/src/caps_features.rs b/gstreamer/src/caps_features.rs index b3ac05e6d..3bc20f582 100644 --- a/gstreamer/src/caps_features.rs +++ b/gstreamer/src/caps_features.rs @@ -239,7 +239,7 @@ impl<'a> ToGlibPtrMut<'a, *mut ffi::GstCapsFeatures> for CapsFeatures { type Storage = PhantomData<&'a mut Self>; #[inline] - fn to_glib_none_mut(&'a mut self) -> StashMut<*mut ffi::GstCapsFeatures, Self> { + fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::GstCapsFeatures, Self> { unsafe { StashMut(self.0.as_mut(), PhantomData) } } } @@ -744,7 +744,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.n_features { return None; @@ -785,9 +785,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> std::iter::FusedIterator for Iter<'a> {} +impl std::iter::FusedIterator for Iter<'_> {} impl<'a> IntoIterator for &'a CapsFeaturesRef { type IntoIter = Iter<'a>; diff --git a/gstreamer/src/caps_features_serde.rs b/gstreamer/src/caps_features_serde.rs index 2fb32e839..a525da396 100644 --- a/gstreamer/src/caps_features_serde.rs +++ b/gstreamer/src/caps_features_serde.rs @@ -26,7 +26,7 @@ const CAPS_FEATURES_VARIANT_NAMES: &[&str] = &[ ]; struct CapsFeaturesForIterSe<'a>(&'a CapsFeaturesRef); -impl<'a> Serialize for CapsFeaturesForIterSe<'a> { +impl Serialize for CapsFeaturesForIterSe<'_> { fn serialize(&self, serializer: S) -> Result { let iter = self.0.iter(); let size = iter.size_hint().0; @@ -95,7 +95,7 @@ impl<'de> Deserialize<'de> for CapsFeaturesSome { } struct CapsFeaturesVariantKindsVisitor; -impl<'de> Visitor<'de> for CapsFeaturesVariantKindsVisitor { +impl Visitor<'_> for CapsFeaturesVariantKindsVisitor { type Value = CapsFeaturesVariantKinds; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/gstreamer/src/caps_serde.rs b/gstreamer/src/caps_serde.rs index 4e9f8d90a..4a428b639 100644 --- a/gstreamer/src/caps_serde.rs +++ b/gstreamer/src/caps_serde.rs @@ -30,7 +30,7 @@ const CAPS_VARIANT_NAMES: &[&str] = &[ ]; struct CapsItemSe<'a>(&'a StructureRef, Option<&'a CapsFeaturesRef>); -impl<'a> Serialize for CapsItemSe<'a> { +impl Serialize for CapsItemSe<'_> { fn serialize(&self, serializer: S) -> Result { let mut tup = serializer.serialize_tuple(2)?; tup.serialize_element(self.0)?; @@ -40,7 +40,7 @@ impl<'a> Serialize for CapsItemSe<'a> { } struct CapsForIterSe<'a>(&'a CapsRef); -impl<'a> Serialize for CapsForIterSe<'a> { +impl Serialize for CapsForIterSe<'_> { fn serialize(&self, serializer: S) -> Result { let iter = self.0.iter_with_features(); let size = iter.size_hint().0; @@ -154,7 +154,7 @@ impl<'de> Deserialize<'de> for CapsSome { } struct CapsVariantKindsVisitor; -impl<'de> Visitor<'de> for CapsVariantKindsVisitor { +impl Visitor<'_> for CapsVariantKindsVisitor { type Value = CapsVariantKinds; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/gstreamer/src/enums.rs b/gstreamer/src/enums.rs index 9d1fa0003..1ccb498a1 100644 --- a/gstreamer/src/enums.rs +++ b/gstreamer/src/enums.rs @@ -737,7 +737,7 @@ impl glib::value::ValueType for MessageType { type Type = Self; } -unsafe impl<'a> FromValue<'a> for MessageType { +unsafe impl FromValue<'_> for MessageType { type Checker = glib::value::GenericValueTypeChecker; #[inline] diff --git a/gstreamer/src/format/clock_time.rs b/gstreamer/src/format/clock_time.rs index 71368215b..5406eff88 100644 --- a/gstreamer/src/format/clock_time.rs +++ b/gstreamer/src/format/clock_time.rs @@ -475,7 +475,7 @@ unsafe impl glib::value::ValueTypeChecker for ClockTimeValueTypeOrNoneChecker { } } -unsafe impl<'a> glib::value::FromValue<'a> for ClockTime { +unsafe impl glib::value::FromValue<'_> for ClockTime { type Checker = ClockTimeValueTypeOrNoneChecker; #[inline] diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index cbeb9f757..0c4d752ab 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -3,6 +3,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::missing_safety_doc)] #![allow(clippy::manual_range_contains)] +#![allow(clippy::manual_c_str_literals)] #![doc = include_str!("../README.md")] // Re-exported for the subclass gst_plugin_define! macro diff --git a/gstreamer/src/memory.rs b/gstreamer/src/memory.rs index bfa7e3558..12d78ffae 100644 --- a/gstreamer/src/memory.rs +++ b/gstreamer/src/memory.rs @@ -352,7 +352,7 @@ impl MemoryRef { } } -impl<'a, T> MemoryMap<'a, T> { +impl MemoryMap<'_, T> { #[doc(alias = "get_size")] #[inline] pub fn size(&self) -> usize { @@ -374,7 +374,7 @@ impl<'a, T> MemoryMap<'a, T> { } } -impl<'a> MemoryMap<'a, Writable> { +impl MemoryMap<'_, Writable> { #[inline] pub fn as_mut_slice(&mut self) -> &mut [u8] { if self.map_info.size == 0 { @@ -384,21 +384,21 @@ impl<'a> MemoryMap<'a, Writable> { } } -impl<'a, T> AsRef<[u8]> for MemoryMap<'a, T> { +impl AsRef<[u8]> for MemoryMap<'_, T> { #[inline] fn as_ref(&self) -> &[u8] { self.as_slice() } } -impl<'a> AsMut<[u8]> for MemoryMap<'a, Writable> { +impl AsMut<[u8]> for MemoryMap<'_, Writable> { #[inline] fn as_mut(&mut self) -> &mut [u8] { self.as_mut_slice() } } -impl<'a, T> Deref for MemoryMap<'a, T> { +impl Deref for MemoryMap<'_, T> { type Target = [u8]; #[inline] @@ -407,14 +407,14 @@ impl<'a, T> Deref for MemoryMap<'a, T> { } } -impl<'a> DerefMut for MemoryMap<'a, Writable> { +impl DerefMut for MemoryMap<'_, Writable> { #[inline] fn deref_mut(&mut self) -> &mut [u8] { self.as_mut_slice() } } -impl<'a, T> fmt::Debug for MemoryMap<'a, T> { +impl fmt::Debug for MemoryMap<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("MemoryMap").field(&self.memory()).finish() } @@ -426,9 +426,9 @@ impl<'a, T> PartialEq for MemoryMap<'a, T> { } } -impl<'a, T> Eq for MemoryMap<'a, T> {} +impl Eq for MemoryMap<'_, T> {} -impl<'a, T> Drop for MemoryMap<'a, T> { +impl Drop for MemoryMap<'_, T> { #[inline] fn drop(&mut self) { unsafe { @@ -437,8 +437,8 @@ impl<'a, T> Drop for MemoryMap<'a, T> { } } -unsafe impl<'a, T> Send for MemoryMap<'a, T> {} -unsafe impl<'a, T> Sync for MemoryMap<'a, T> {} +unsafe impl Send for MemoryMap<'_, T> {} +unsafe impl Sync for MemoryMap<'_, T> {} impl MappedMemory { #[inline] @@ -545,7 +545,7 @@ pub struct Dump<'a> { end: Bound, } -impl<'a> Dump<'a> { +impl Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter, debug: bool) -> fmt::Result { let map = self.memory.map_readable().expect("Failed to map memory"); let data = map.as_slice(); @@ -564,13 +564,13 @@ impl<'a> Dump<'a> { } } -impl<'a> fmt::Display for Dump<'a> { +impl fmt::Display for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.fmt(f, false) } } -impl<'a> fmt::Debug for Dump<'a> { +impl fmt::Debug for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt(f, true) } diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index 3bc8dc282..28a3b9198 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -102,7 +102,7 @@ impl<'a, T: fmt::Debug + 'a, U> fmt::Debug for MetaRefMut<'a, T, U> { } } -impl<'a, T> ops::Deref for MetaRef<'a, T> { +impl ops::Deref for MetaRef<'_, T> { type Target = T; #[inline] @@ -118,7 +118,7 @@ impl<'a, T> AsRef> for MetaRef<'a, T> { } } -impl<'a, T> AsRef for MetaRef<'a, T> { +impl AsRef for MetaRef<'_, T> { #[inline] fn as_ref(&self) -> &T { self.meta @@ -134,7 +134,7 @@ impl<'a, T: 'a> Clone for MetaRef<'a, T> { } } -impl<'a, T, U> ops::Deref for MetaRefMut<'a, T, U> { +impl ops::Deref for MetaRefMut<'_, T, U> { type Target = T; #[inline] @@ -143,7 +143,7 @@ impl<'a, T, U> ops::Deref for MetaRefMut<'a, T, U> { } } -impl<'a, T, U> ops::DerefMut for MetaRefMut<'a, T, U> { +impl ops::DerefMut for MetaRefMut<'_, T, U> { #[inline] fn deref_mut(&mut self) -> &mut T { self.meta @@ -157,7 +157,7 @@ impl<'a, T, U> AsRef> for MetaRefMut<'a, T, U> { } } -impl<'a, T, U> AsMut for MetaRefMut<'a, T, U> { +impl AsMut for MetaRefMut<'_, T, U> { #[inline] fn as_mut(&mut self) -> &mut T { self.meta @@ -531,7 +531,7 @@ impl<'a, T, U> MetaRefMut<'a, T, U> { } } -impl<'a, T> MetaRefMut<'a, T, Standalone> { +impl MetaRefMut<'_, T, Standalone> { #[doc(alias = "gst_buffer_remove_meta")] pub fn remove(self) -> Result<(), glib::BoolError> { if self.flags().contains(crate::MetaFlags::LOCKED) { @@ -1088,7 +1088,7 @@ impl MetaTransformCopy { } } -unsafe impl<'a> MetaTransform<'a> for MetaTransformCopy { +unsafe impl MetaTransform<'_> for MetaTransformCopy { type GLibType = ffi::GstMetaTransformCopy; fn quark() -> glib::Quark { diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index a69cdc6f8..0ba61eb4b 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -209,7 +209,7 @@ macro_rules! mini_object_wrapper ( type Storage = std::marker::PhantomData<&'a mut Self>; #[inline] - fn to_glib_none_mut(&'a mut self) -> $crate::glib::translate::StashMut<*mut $ffi_name, Self> { + fn to_glib_none_mut(&'_ mut self) -> $crate::glib::translate::StashMut<*mut $ffi_name, Self> { self.make_mut(); $crate::glib::translate::StashMut(self.as_mut_ptr(), std::marker::PhantomData) } diff --git a/gstreamer/src/object.rs b/gstreamer/src/object.rs index 87fde009d..76d6374e1 100644 --- a/gstreamer/src/object.rs +++ b/gstreamer/src/object.rs @@ -74,7 +74,6 @@ pub trait GstObjectExtManual: IsA + 'static { #[doc(alias = "get_g_value_array")] #[doc(alias = "gst_object_get_g_value_array")] - fn g_value_array( &self, property_name: &str, diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 6730bcaf0..e874b7349 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -57,7 +57,7 @@ pub struct PadProbeInfo<'a> { pub flow_res: Result, } -impl<'a> PadProbeInfo<'a> { +impl PadProbeInfo<'_> { pub fn buffer(&self) -> Option<&Buffer> { match self.data { Some(PadProbeData::Buffer(ref buffer)) => Some(buffer), @@ -166,13 +166,13 @@ pub enum PadProbeData<'a> { __Unknown(*mut ffi::GstMiniObject), } -unsafe impl<'a> Send for PadProbeData<'a> {} -unsafe impl<'a> Sync for PadProbeData<'a> {} +unsafe impl Send for PadProbeData<'_> {} +unsafe impl Sync for PadProbeData<'_> {} #[derive(Debug)] #[must_use = "if unused the StreamLock will immediately unlock"] pub struct StreamLock<'a>(&'a Pad); -impl<'a> Drop for StreamLock<'a> { +impl Drop for StreamLock<'_> { #[inline] fn drop(&mut self) { unsafe { diff --git a/gstreamer/src/pad_template.rs b/gstreamer/src/pad_template.rs index a0e180ba6..2d9bb262d 100644 --- a/gstreamer/src/pad_template.rs +++ b/gstreamer/src/pad_template.rs @@ -111,6 +111,7 @@ pub struct PadTemplateBuilder<'a> { documentation_caps: Option<&'a Caps>, } +#[allow(clippy::needless_lifetimes)] impl<'a> PadTemplateBuilder<'a> { pub fn gtype(self, gtype: glib::Type) -> Self { PadTemplateBuilder { diff --git a/gstreamer/src/param_spec.rs b/gstreamer/src/param_spec.rs index 82c739062..2a7d17a1d 100644 --- a/gstreamer/src/param_spec.rs +++ b/gstreamer/src/param_spec.rs @@ -33,7 +33,7 @@ impl HasParamSpec for crate::Fraction { type ParamSpec = ParamSpecFraction; type SetValue = crate::Fraction; - type BuilderFn = for<'a> fn(&'a str) -> ParamSpecFractionBuilder; + type BuilderFn = for<'a> fn(&'a str) -> ParamSpecFractionBuilder<'a>; fn param_spec_builder() -> Self::BuilderFn { ParamSpecFraction::builder @@ -229,7 +229,7 @@ impl HasParamSpec for crate::Array { type ParamSpec = ParamSpecArray; type SetValue = crate::Array; - type BuilderFn = for<'a> fn(&'a str) -> ParamSpecArrayBuilder; + type BuilderFn = for<'a> fn(&'a str) -> ParamSpecArrayBuilder<'a>; fn param_spec_builder() -> Self::BuilderFn { ParamSpecArray::builder diff --git a/gstreamer/src/slice.rs b/gstreamer/src/slice.rs index b0409d0f2..0730c9f0d 100644 --- a/gstreamer/src/slice.rs +++ b/gstreamer/src/slice.rs @@ -12,7 +12,7 @@ pub trait ByteSliceExt { fn dump_range(&self, range: impl RangeBounds) -> Dump; } -impl<'a> ByteSliceExt for &'a [u8] { +impl ByteSliceExt for &[u8] { fn dump(&self) -> Dump { self.dump_range(..) } @@ -26,7 +26,7 @@ impl<'a> ByteSliceExt for &'a [u8] { } } -impl<'a> ByteSliceExt for &'a mut [u8] { +impl ByteSliceExt for &mut [u8] { fn dump(&self) -> Dump { self.dump_range(..) } @@ -46,7 +46,7 @@ pub struct Dump<'a> { pub(crate) end: Bound, } -impl<'a> Dump<'a> { +impl Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter, debug: bool) -> fmt::Result { use std::fmt::Write; @@ -148,13 +148,13 @@ impl<'a> Dump<'a> { } } -impl<'a> fmt::Display for Dump<'a> { +impl fmt::Display for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.fmt(f, false) } } -impl<'a> fmt::Debug for Dump<'a> { +impl fmt::Debug for Dump<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.fmt(f, true) } diff --git a/gstreamer/src/stream.rs b/gstreamer/src/stream.rs index 505a422e9..3b8c7be5c 100644 --- a/gstreamer/src/stream.rs +++ b/gstreamer/src/stream.rs @@ -12,7 +12,7 @@ impl Stream { pub struct Debug<'a>(&'a Stream); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Stream") .field("stream_id", &self.0.stream_id()) diff --git a/gstreamer/src/stream_collection.rs b/gstreamer/src/stream_collection.rs index b703e9f08..8bb9cc3aa 100644 --- a/gstreamer/src/stream_collection.rs +++ b/gstreamer/src/stream_collection.rs @@ -28,7 +28,7 @@ impl<'a> Iter<'a> { } } -impl<'a> Iterator for Iter<'a> { +impl Iterator for Iter<'_> { type Item = Stream; fn next(&mut self) -> Option { @@ -72,7 +72,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.size { return None; @@ -94,9 +94,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> std::iter::FusedIterator for Iter<'a> {} +impl std::iter::FusedIterator for Iter<'_> {} #[derive(Debug, Clone)] #[must_use = "The builder must be built to be used"] @@ -271,11 +271,11 @@ impl<'a> IntoIterator for &'a StreamCollection { pub struct Debug<'a>(&'a StreamCollection); -impl<'a> fmt::Debug for Debug<'a> { +impl fmt::Debug for Debug<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { struct Streams<'a>(&'a StreamCollection); - impl<'a> fmt::Debug for Streams<'a> { + impl fmt::Debug for Streams<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut f = f.debug_list(); diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 71b007aa0..b488d4f86 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -340,7 +340,7 @@ impl<'a> ToGlibPtrMut<'a, *mut ffi::GstStructure> for Structure { type Storage = PhantomData<&'a mut Self>; #[inline] - fn to_glib_none_mut(&'a mut self) -> StashMut<*mut ffi::GstStructure, Self> { + fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::GstStructure, Self> { unsafe { StashMut(self.0.as_mut(), PhantomData) } } } @@ -1796,7 +1796,7 @@ impl<'a> Iterator for FieldIterator<'a> { } } -impl<'a> DoubleEndedIterator for FieldIterator<'a> { +impl DoubleEndedIterator for FieldIterator<'_> { fn next_back(&mut self) -> Option { if self.idx == self.n_fields { return None; @@ -1809,9 +1809,9 @@ impl<'a> DoubleEndedIterator for FieldIterator<'a> { } } -impl<'a> ExactSizeIterator for FieldIterator<'a> {} +impl ExactSizeIterator for FieldIterator<'_> {} -impl<'a> std::iter::FusedIterator for FieldIterator<'a> {} +impl std::iter::FusedIterator for FieldIterator<'_> {} #[cfg(feature = "v1_26")] #[derive(Debug)] @@ -1858,7 +1858,7 @@ impl<'a> Iterator for FieldIdIterator<'a> { } #[cfg(feature = "v1_26")] -impl<'a> DoubleEndedIterator for FieldIdIterator<'a> { +impl DoubleEndedIterator for FieldIdIterator<'_> { fn next_back(&mut self) -> Option { if self.idx == self.n_fields { return None; @@ -1872,9 +1872,9 @@ impl<'a> DoubleEndedIterator for FieldIdIterator<'a> { } #[cfg(feature = "v1_26")] -impl<'a> ExactSizeIterator for FieldIdIterator<'a> {} +impl ExactSizeIterator for FieldIdIterator<'_> {} #[cfg(feature = "v1_26")] -impl<'a> std::iter::FusedIterator for FieldIdIterator<'a> {} +impl std::iter::FusedIterator for FieldIdIterator<'_> {} #[derive(Debug)] pub struct Iter<'a> { @@ -1921,7 +1921,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { let f = self.iter.next_back()?; let v = self.iter.structure.value(f); @@ -1935,9 +1935,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> std::iter::FusedIterator for Iter<'a> {} +impl std::iter::FusedIterator for Iter<'_> {} #[cfg(feature = "v1_26")] #[derive(Debug)] @@ -1988,7 +1988,7 @@ impl<'a> Iterator for IdIter<'a> { } #[cfg(feature = "v1_26")] -impl<'a> DoubleEndedIterator for IdIter<'a> { +impl DoubleEndedIterator for IdIter<'_> { fn next_back(&mut self) -> Option { let f = self.iter.next_back()?; let v = self.iter.structure.value_by_id(f); @@ -2003,9 +2003,9 @@ impl<'a> DoubleEndedIterator for IdIter<'a> { } #[cfg(feature = "v1_26")] -impl<'a> ExactSizeIterator for IdIter<'a> {} +impl ExactSizeIterator for IdIter<'_> {} #[cfg(feature = "v1_26")] -impl<'a> std::iter::FusedIterator for IdIter<'a> {} +impl std::iter::FusedIterator for IdIter<'_> {} impl<'a> IntoIterator for &'a StructureRef { type IntoIter = Iter<'a>; diff --git a/gstreamer/src/structure_serde.rs b/gstreamer/src/structure_serde.rs index f54c1c4f8..aec5c8dbd 100644 --- a/gstreamer/src/structure_serde.rs +++ b/gstreamer/src/structure_serde.rs @@ -17,7 +17,7 @@ use crate::{ }; struct FieldSe<'a>(&'a str, &'a glib::SendValue); -impl<'a> Serialize for FieldSe<'a> { +impl Serialize for FieldSe<'_> { fn serialize(&self, serializer: S) -> Result { ser_value!(self.1, |type_, value| { let mut tup = serializer.serialize_tuple(3)?; @@ -30,7 +30,7 @@ impl<'a> Serialize for FieldSe<'a> { } struct StructureForIter<'a>(&'a StructureRef); -impl<'a> Serialize for StructureForIter<'a> { +impl Serialize for StructureForIter<'_> { fn serialize(&self, serializer: S) -> Result { let iter = self.0.iter(); let size = iter.size_hint().0; @@ -103,7 +103,7 @@ impl<'de> Deserialize<'de> for FieldDe { struct FieldsDe<'a>(&'a mut StructureRef); struct FieldsVisitor<'a>(&'a mut StructureRef); -impl<'de, 'a> Visitor<'de> for FieldsVisitor<'a> { +impl<'de> Visitor<'de> for FieldsVisitor<'_> { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -120,7 +120,7 @@ impl<'de, 'a> Visitor<'de> for FieldsVisitor<'a> { } } -impl<'de, 'a> DeserializeSeed<'de> for FieldsDe<'a> { +impl<'de> DeserializeSeed<'de> for FieldsDe<'_> { type Value = (); fn deserialize>(self, deserializer: D) -> Result<(), D::Error> { diff --git a/gstreamer/src/subclass/error.rs b/gstreamer/src/subclass/error.rs index 189a3c707..26edf1785 100644 --- a/gstreamer/src/subclass/error.rs +++ b/gstreamer/src/subclass/error.rs @@ -95,7 +95,7 @@ impl From for FlowReturn { } } -impl<'a> From<&'a FlowError> for FlowReturn { +impl From<&FlowError> for FlowReturn { fn from(err: &FlowError) -> FlowReturn { match *err { FlowError::Flushing => FlowReturn::Flushing, diff --git a/gstreamer/src/tags.rs b/gstreamer/src/tags.rs index 33df21941..1c034e408 100644 --- a/gstreamer/src/tags.rs +++ b/gstreamer/src/tags.rs @@ -811,7 +811,7 @@ impl<'a> Iterator for GenericTagIter<'a> { } } -impl<'a> DoubleEndedIterator for GenericTagIter<'a> { +impl DoubleEndedIterator for GenericTagIter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.size { return None; @@ -833,9 +833,9 @@ impl<'a> DoubleEndedIterator for GenericTagIter<'a> { } } -impl<'a> ExactSizeIterator for GenericTagIter<'a> {} +impl ExactSizeIterator for GenericTagIter<'_> {} -impl<'a> std::iter::FusedIterator for GenericTagIter<'a> {} +impl std::iter::FusedIterator for GenericTagIter<'_> {} #[derive(Debug)] pub struct GenericIter<'a> { @@ -903,7 +903,7 @@ impl<'a> Iterator for GenericIter<'a> { } } -impl<'a> DoubleEndedIterator for GenericIter<'a> { +impl DoubleEndedIterator for GenericIter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.size { return None; @@ -927,9 +927,9 @@ impl<'a> DoubleEndedIterator for GenericIter<'a> { } } -impl<'a> ExactSizeIterator for GenericIter<'a> {} +impl ExactSizeIterator for GenericIter<'_> {} -impl<'a> std::iter::FusedIterator for GenericIter<'a> {} +impl std::iter::FusedIterator for GenericIter<'_> {} #[derive(Debug)] pub struct Iter<'a> { @@ -997,7 +997,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> DoubleEndedIterator for Iter<'a> { +impl DoubleEndedIterator for Iter<'_> { fn next_back(&mut self) -> Option { if self.idx == self.size { return None; @@ -1021,9 +1021,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { } } -impl<'a> ExactSizeIterator for Iter<'a> {} +impl ExactSizeIterator for Iter<'_> {} -impl<'a> std::iter::FusedIterator for Iter<'a> {} +impl std::iter::FusedIterator for Iter<'_> {} #[doc(alias = "gst_tag_exists")] pub fn tag_exists(name: impl IntoGStr) -> bool { @@ -1306,7 +1306,7 @@ mod tests { const TAG_NAME: &'static glib::GStr = glib::gstr!("my-custom-tag"); } - impl<'a> CustomTag<'a> for MyCustomTag { + impl CustomTag<'_> for MyCustomTag { const FLAG: crate::TagFlag = crate::TagFlag::Meta; const NICK: &'static glib::GStr = glib::gstr!("my custom tag"); const DESCRIPTION: &'static glib::GStr = diff --git a/gstreamer/src/tags_serde.rs b/gstreamer/src/tags_serde.rs index 5ba757e79..8354d5017 100644 --- a/gstreamer/src/tags_serde.rs +++ b/gstreamer/src/tags_serde.rs @@ -52,7 +52,7 @@ impl<'a> TagValuesSer<'a> { } } -impl<'a> Serialize for TagValuesSer<'a> { +impl Serialize for TagValuesSer<'_> { #[allow(clippy::redundant_closure_call)] fn serialize(&self, serializer: S) -> Result { use std::ops::DerefMut; @@ -102,7 +102,7 @@ impl<'a> TagsSer<'a> { } } -impl<'a> Serialize for TagsSer<'a> { +impl Serialize for TagsSer<'_> { fn serialize(&self, serializer: S) -> Result { let mut tup = serializer.serialize_tuple(2)?; tup.serialize_element(self.0)?; @@ -112,7 +112,7 @@ impl<'a> Serialize for TagsSer<'a> { } struct TagListSer<'a>(&'a TagListRef); -impl<'a> Serialize for TagListSer<'a> { +impl Serialize for TagListSer<'_> { fn serialize(&self, serializer: S) -> Result { let tag_count = self.0.n_tags(); match tag_count.cmp(&0) { @@ -162,7 +162,7 @@ macro_rules! de_opt_tag( struct TagValues<'a>(&'a str, &'a mut TagListRef); struct TagValuesVisitor<'a>(&'a str, &'a mut TagListRef); -impl<'de, 'a> Visitor<'de> for TagValuesVisitor<'a> { +impl<'de> Visitor<'de> for TagValuesVisitor<'_> { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -218,7 +218,7 @@ impl<'de, 'a> Visitor<'de> for TagValuesVisitor<'a> { } } -impl<'de, 'a> DeserializeSeed<'de> for TagValues<'a> { +impl<'de> DeserializeSeed<'de> for TagValues<'_> { type Value = (); fn deserialize>(self, deserializer: D) -> Result<(), D::Error> { @@ -230,7 +230,7 @@ impl<'de, 'a> DeserializeSeed<'de> for TagValues<'a> { struct TagValuesTuple<'a>(&'a mut TagListRef); struct TagValuesTupleVisitor<'a>(&'a mut TagListRef); -impl<'de, 'a> Visitor<'de> for TagValuesTupleVisitor<'a> { +impl<'de> Visitor<'de> for TagValuesTupleVisitor<'_> { type Value = (); fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -248,7 +248,7 @@ impl<'de, 'a> Visitor<'de> for TagValuesTupleVisitor<'a> { } } -impl<'de, 'a> DeserializeSeed<'de> for TagValuesTuple<'a> { +impl<'de> DeserializeSeed<'de> for TagValuesTuple<'_> { type Value = (); fn deserialize>(self, deserializer: D) -> Result<(), D::Error> { diff --git a/gstreamer/src/task.rs b/gstreamer/src/task.rs index 688cd2908..48511e0b2 100644 --- a/gstreamer/src/task.rs +++ b/gstreamer/src/task.rs @@ -237,7 +237,7 @@ impl Drop for RecMutex { } } -impl<'a> Drop for TaskLockGuard<'a> { +impl Drop for TaskLockGuard<'_> { #[inline] fn drop(&mut self) { unsafe { diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index b3366f688..ba6b8ed6e 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -937,8 +937,8 @@ impl glib::types::StaticType for Array { #[derive(Debug, Clone)] pub struct ArrayRef<'a>(&'a [glib::SendValue]); -unsafe impl<'a> Send for ArrayRef<'a> {} -unsafe impl<'a> Sync for ArrayRef<'a> {} +unsafe impl Send for ArrayRef<'_> {} +unsafe impl Sync for ArrayRef<'_> {} impl<'a> ArrayRef<'a> { pub fn new(values: &'a [glib::SendValue]) -> Self { @@ -953,7 +953,7 @@ impl<'a> ArrayRef<'a> { } } -impl<'a> ops::Deref for ArrayRef<'a> { +impl ops::Deref for ArrayRef<'_> { type Target = [glib::SendValue]; #[inline] @@ -962,7 +962,7 @@ impl<'a> ops::Deref for ArrayRef<'a> { } } -impl<'a> AsRef<[glib::SendValue]> for ArrayRef<'a> { +impl AsRef<[glib::SendValue]> for ArrayRef<'_> { #[inline] fn as_ref(&self) -> &[glib::SendValue] { self.as_slice() @@ -988,7 +988,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for ArrayRef<'a> { } } -impl<'a> glib::value::ToValue for ArrayRef<'a> { +impl glib::value::ToValue for ArrayRef<'_> { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); @@ -1014,7 +1014,7 @@ impl<'a> From> for glib::Value { } } -impl<'a> glib::types::StaticType for ArrayRef<'a> { +impl glib::types::StaticType for ArrayRef<'_> { #[inline] fn static_type() -> glib::types::Type { unsafe { from_glib(ffi::gst_value_array_get_type()) } @@ -1164,8 +1164,8 @@ impl glib::types::StaticType for List { #[derive(Debug, Clone)] pub struct ListRef<'a>(&'a [glib::SendValue]); -unsafe impl<'a> Send for ListRef<'a> {} -unsafe impl<'a> Sync for ListRef<'a> {} +unsafe impl Send for ListRef<'_> {} +unsafe impl Sync for ListRef<'_> {} impl<'a> ListRef<'a> { pub fn new(values: &'a [glib::SendValue]) -> Self { @@ -1180,7 +1180,7 @@ impl<'a> ListRef<'a> { } } -impl<'a> ops::Deref for ListRef<'a> { +impl ops::Deref for ListRef<'_> { type Target = [glib::SendValue]; #[inline] @@ -1189,7 +1189,7 @@ impl<'a> ops::Deref for ListRef<'a> { } } -impl<'a> AsRef<[glib::SendValue]> for ListRef<'a> { +impl AsRef<[glib::SendValue]> for ListRef<'_> { #[inline] fn as_ref(&self) -> &[glib::SendValue] { self.as_slice() @@ -1215,7 +1215,7 @@ unsafe impl<'a> glib::value::FromValue<'a> for ListRef<'a> { } } -impl<'a> glib::value::ToValue for ListRef<'a> { +impl glib::value::ToValue for ListRef<'_> { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); @@ -1241,7 +1241,7 @@ impl<'a> From> for glib::Value { } } -impl<'a> glib::types::StaticType for ListRef<'a> { +impl glib::types::StaticType for ListRef<'_> { #[inline] fn static_type() -> glib::types::Type { unsafe { from_glib(ffi::gst_value_list_get_type()) } diff --git a/tutorials/src/tutorials-common.rs b/tutorials/src/tutorials-common.rs index aec68ddd0..c751b81aa 100644 --- a/tutorials/src/tutorials-common.rs +++ b/tutorials/src/tutorials-common.rs @@ -1,7 +1,6 @@ /// macOS has a specific requirement that there must be a run loop running on the main thread in /// order to open windows and use OpenGL, and that the global NSApplication instance must be /// initialized. - /// On macOS this launches the callback function on a thread. /// On other platforms it's just executed immediately. #[cfg(not(target_os = "macos"))]