diff --git a/examples/src/bin/glupload.rs b/examples/src/bin/glupload.rs index 35ecad389..0bc5debe6 100644 --- a/examples/src/bin/glupload.rs +++ b/examples/src/bin/glupload.rs @@ -51,7 +51,11 @@ struct ErrorMessage { cause: glib::Error, } -#[cfg_attr(rustfmt, rustfmt_skip)] +#[derive(Debug, Fail)] +#[fail(display = "Glutin error")] +struct GlutinError(); + +#[rustfmt::skip] static VERTICES: [f32; 20] = [ 1.0, 1.0, 0.0, 1.0, 0.0, -1.0, 1.0, 0.0, 0.0, 0.0, @@ -61,7 +65,7 @@ static VERTICES: [f32; 20] = [ static INDICES: [u16; 6] = [0, 1, 2, 0, 2, 3]; -#[cfg_attr(rustfmt, rustfmt_skip)] +#[rustfmt::skip] static IDENTITY: [f32; 16] = [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index 5292cb6ff..eab4266dd 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -128,7 +128,7 @@ fn create_ui(app: >k::Application) { // This is unsafe because the "window handle" we pass here is basically like a raw pointer. // If a wrong value were to be passed here (and you can pass any integer), then the window // system will most likely cause the application to crash. - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { // Here we ask gdk what native window handle we got assigned for // our video region from the window system, and then we will @@ -152,7 +152,7 @@ fn create_ui(app: >k::Application) { // This is unsafe because the "window handle" we pass here is basically like a raw pointer. // If a wrong value were to be passed here (and you can pass any integer), then the window // system will most likely cause the application to crash. - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { // Here we ask gdk what native window handle we got assigned for // our video region from the windowing system, and then we will diff --git a/gstreamer-app/src/app_sink.rs b/gstreamer-app/src/app_sink.rs index bff56d686..deb4c3361 100644 --- a/gstreamer-app/src/app_sink.rs +++ b/gstreamer-app/src/app_sink.rs @@ -20,7 +20,7 @@ use std::mem::transmute; use std::ptr; use AppSink; -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::type_complexity)] pub struct AppSinkCallbacks { eos: Option>>, new_preroll: Option< @@ -46,7 +46,7 @@ impl AppSinkCallbacks { } } -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::type_complexity)] pub struct AppSinkCallbacksBuilder { eos: Option>>, new_preroll: Option< diff --git a/gstreamer-app/src/app_src.rs b/gstreamer-app/src/app_src.rs index 701a18f92..1574cc058 100644 --- a/gstreamer-app/src/app_src.rs +++ b/gstreamer-app/src/app_src.rs @@ -15,7 +15,7 @@ use std::mem; use std::ptr; use AppSrc; -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::type_complexity)] pub struct AppSrcCallbacks { need_data: Option>>, enough_data: Option>, @@ -38,7 +38,7 @@ impl AppSrcCallbacks { } } -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::type_complexity)] pub struct AppSrcCallbacksBuilder { need_data: Option>>, enough_data: Option>, diff --git a/gstreamer-app/src/lib.rs b/gstreamer-app/src/lib.rs index ace619f84..101982cdb 100644 --- a/gstreamer-app/src/lib.rs +++ b/gstreamer-app/src/lib.rs @@ -25,10 +25,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-audio/src/audio_info.rs b/gstreamer-audio/src/audio_info.rs index 46a579cd7..56db27663 100644 --- a/gstreamer-audio/src/audio_info.rs +++ b/gstreamer-audio/src/audio_info.rs @@ -133,7 +133,7 @@ impl<'a> AudioInfoBuilder<'a> { } impl AudioInfo { - #[cfg_attr(feature = "cargo-clippy", allow(new_ret_no_self))] + #[allow(clippy::new_ret_no_self)] pub fn new<'a>(format: ::AudioFormat, rate: u32, channels: u32) -> AudioInfoBuilder<'a> { assert_initialized_main_thread!(); diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index e82689bc1..43de2dab5 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -32,10 +32,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index 6338741b0..dd0677f2e 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -28,11 +28,10 @@ macro_rules! assert_initialized_main_thread { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] #[rustfmt::skip] mod auto; pub use auto::functions::*; diff --git a/gstreamer-base/src/subclass/mod.rs b/gstreamer-base/src/subclass/mod.rs index caf292834..efe1f4360 100644 --- a/gstreamer-base/src/subclass/mod.rs +++ b/gstreamer-base/src/subclass/mod.rs @@ -6,7 +6,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] +#![allow(clippy::cast_ptr_alignment)] pub mod base_sink; pub mod base_src; diff --git a/gstreamer-base/src/utils.rs b/gstreamer-base/src/utils.rs index a7ef46a0d..6ee68c29a 100644 --- a/gstreamer-base/src/utils.rs +++ b/gstreamer-base/src/utils.rs @@ -12,7 +12,7 @@ use glib_ffi; pub struct MutexGuard<'a>(&'a glib_ffi::GMutex); impl<'a> MutexGuard<'a> { - #[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] + #[allow(clippy::trivially_copy_pass_by_ref)] pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self { unsafe { glib_ffi::g_mutex_lock(mut_override(mutex)); diff --git a/gstreamer-check/src/lib.rs b/gstreamer-check/src/lib.rs index fd93c76ec..7bdd83d02 100644 --- a/gstreamer-check/src/lib.rs +++ b/gstreamer-check/src/lib.rs @@ -25,11 +25,10 @@ macro_rules! assert_initialized_main_thread { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index b44d1dbb3..c657234dd 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -66,10 +66,9 @@ macro_rules! skip_assert_initialized { () => {}; } -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-gl/src/lib.rs b/gstreamer-gl/src/lib.rs index 82fd4c958..7fb5672d9 100644 --- a/gstreamer-gl/src/lib.rs +++ b/gstreamer-gl/src/lib.rs @@ -38,10 +38,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-net/src/lib.rs b/gstreamer-net/src/lib.rs index a38af1035..23a4fc5cc 100644 --- a/gstreamer-net/src/lib.rs +++ b/gstreamer-net/src/lib.rs @@ -26,10 +26,9 @@ macro_rules! assert_initialized_main_thread { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-net/src/net_address_meta.rs b/gstreamer-net/src/net_address_meta.rs index dd911c90d..97b917411 100644 --- a/gstreamer-net/src/net_address_meta.rs +++ b/gstreamer-net/src/net_address_meta.rs @@ -29,7 +29,7 @@ impl NetAddressMeta { } pub fn set_addr>(&mut self, addr: &T) { - #![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #![allow(clippy::cast_ptr_alignment)] unsafe { gobject_ffi::g_object_unref(self.0.addr as *mut _); self.0.addr = addr.as_ref().to_glib_full(); diff --git a/gstreamer-pbutils/src/lib.rs b/gstreamer-pbutils/src/lib.rs index d1277ec1a..8ae88053d 100644 --- a/gstreamer-pbutils/src/lib.rs +++ b/gstreamer-pbutils/src/lib.rs @@ -39,11 +39,10 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] #[rustfmt::skip] mod auto; pub use auto::functions::*; diff --git a/gstreamer-player/src/lib.rs b/gstreamer-player/src/lib.rs index 3c8587b00..70a90a47f 100644 --- a/gstreamer-player/src/lib.rs +++ b/gstreamer-player/src/lib.rs @@ -28,13 +28,11 @@ macro_rules! assert_initialized_main_thread { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] -#[cfg_attr(feature = "cargo-clippy", allow(useless_transmute))] -#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] +#[allow(clippy::cast_ptr_alignment)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-player/src/player.rs b/gstreamer-player/src/player.rs index 087d50e34..d01cd279e 100644 --- a/gstreamer-player/src/player.rs +++ b/gstreamer-player/src/player.rs @@ -56,7 +56,7 @@ impl Player { &self, f: F, ) -> SignalHandlerId { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( @@ -72,7 +72,7 @@ impl Player { &self, f: F, ) -> SignalHandlerId { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( @@ -88,7 +88,7 @@ impl Player { &self, f: F, ) -> SignalHandlerId { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let f: Box_ = Box_::new(f); connect_raw( diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs index 9a42e2491..734074e72 100644 --- a/gstreamer-rtsp-server/src/lib.rs +++ b/gstreamer-rtsp-server/src/lib.rs @@ -42,11 +42,10 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-rtsp-server/src/rtsp_session_pool.rs b/gstreamer-rtsp-server/src/rtsp_session_pool.rs index 492a68f4c..12f85639b 100644 --- a/gstreamer-rtsp-server/src/rtsp_session_pool.rs +++ b/gstreamer-rtsp-server/src/rtsp_session_pool.rs @@ -26,7 +26,7 @@ unsafe extern "C" fn destroy_closure_watch< } fn into_raw_watch Continue + Send + 'static>(func: F) -> gpointer { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] let func: Box> = Box::new(RefCell::new(func)); Box::into_raw(func) as gpointer } diff --git a/gstreamer-rtsp/src/lib.rs b/gstreamer-rtsp/src/lib.rs index 8a999c92b..42672561f 100644 --- a/gstreamer-rtsp/src/lib.rs +++ b/gstreamer-rtsp/src/lib.rs @@ -34,10 +34,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs index c7dd17b74..b695309e1 100644 --- a/gstreamer-sdp/src/lib.rs +++ b/gstreamer-sdp/src/lib.rs @@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[allow(non_snake_case)] #[rustfmt::skip] mod auto; diff --git a/gstreamer-sdp/src/sdp_time.rs b/gstreamer-sdp/src/sdp_time.rs index c513653ed..1e548319b 100644 --- a/gstreamer-sdp/src/sdp_time.rs +++ b/gstreamer-sdp/src/sdp_time.rs @@ -41,7 +41,7 @@ impl SDPTime { } pub fn repeat(&self) -> Vec<&str> { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let arr = (*self.0.repeat).data as *const *const c_char; let len = (*self.0.repeat).len as usize; diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index cf7365e93..a76d0f3a7 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -35,10 +35,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index f32268afc..48dc62d9e 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -442,7 +442,7 @@ impl<'a> VideoInfoBuilder<'a> { } impl VideoInfo { - #[cfg_attr(feature = "cargo-clippy", allow(new_ret_no_self))] + #[allow(clippy::new_ret_no_self)] pub fn new<'a>(format: ::VideoFormat, width: u32, height: u32) -> VideoInfoBuilder<'a> { assert_initialized_main_thread!(); diff --git a/gstreamer-video/src/video_meta.rs b/gstreamer-video/src/video_meta.rs index 4f25ca665..03a925696 100644 --- a/gstreamer-video/src/video_meta.rs +++ b/gstreamer-video/src/video_meta.rs @@ -154,7 +154,7 @@ impl VideoOverlayCompositionMeta { } pub fn set_overlay(&mut self, overlay: &::VideoOverlayComposition) { - #![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #![allow(clippy::cast_ptr_alignment)] unsafe { gst_ffi::gst_mini_object_unref(self.0.overlay as *mut _); self.0.overlay = gst_ffi::gst_mini_object_ref(overlay.as_mut_ptr() as *mut _) as *mut _; diff --git a/gstreamer-video/src/video_time_code.rs b/gstreamer-video/src/video_time_code.rs index 858aec83f..36850d3ed 100644 --- a/gstreamer-video/src/video_time_code.rs +++ b/gstreamer-video/src/video_time_code.rs @@ -516,7 +516,7 @@ impl VideoTimeCodeMeta { } pub fn set_tc(&mut self, tc: ValidVideoTimeCode) { - #![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #![allow(clippy::cast_ptr_alignment)] unsafe { ffi::gst_video_time_code_clear(&mut self.0.tc); self.0.tc = tc.0; diff --git a/gstreamer-webrtc/src/lib.rs b/gstreamer-webrtc/src/lib.rs index b26a77a22..91b3f0d79 100644 --- a/gstreamer-webrtc/src/lib.rs +++ b/gstreamer-webrtc/src/lib.rs @@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] #[rustfmt::skip] mod auto; pub use auto::*; diff --git a/gstreamer/src/bus.rs b/gstreamer/src/bus.rs index b6c0e40e9..4582f8581 100644 --- a/gstreamer/src/bus.rs +++ b/gstreamer/src/bus.rs @@ -36,7 +36,7 @@ unsafe extern "C" fn destroy_closure_watch Continue } fn into_raw_watch Continue + 'static>(func: F) -> gpointer { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] let func: Box> = Box::new(RefCell::new(func)); Box::into_raw(func) as gpointer } diff --git a/gstreamer/src/clock.rs b/gstreamer/src/clock.rs index 836943fa9..64930b294 100644 --- a/gstreamer/src/clock.rs +++ b/gstreamer/src/clock.rs @@ -56,7 +56,7 @@ unsafe extern "C" fn destroy_closure_wait_async< } fn into_raw_wait_async(func: F) -> gpointer { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] let func: Box = Box::new(func); Box::into_raw(func) as gpointer } diff --git a/gstreamer/src/clock_time.rs b/gstreamer/src/clock_time.rs index 158393534..c45fa4bc5 100644 --- a/gstreamer/src/clock_time.rs +++ b/gstreamer/src/clock_time.rs @@ -65,7 +65,7 @@ impl ClockTime { } impl fmt::Display for ClockTime { - #[cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))] + #[allow(clippy::many_single_char_names)] fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { let precision = f.precision().unwrap_or(9); // TODO: Could also check width and pad the hours as needed diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index a4269f829..ac10a5f70 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -123,7 +123,7 @@ pub trait ElementExtManual: 'static { fn get_pad_template(&self, name: &str) -> Option; fn get_pad_template_list(&self) -> Vec; - #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] + #[allow(clippy::too_many_arguments)] fn message_full( &self, type_: ElementMessageType, @@ -136,7 +136,7 @@ pub trait ElementExtManual: 'static { ); #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] + #[allow(clippy::too_many_arguments)] fn message_full_with_details( &self, type_: ElementMessageType, diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index 480bab943..256a18027 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -916,7 +916,7 @@ impl<'a> EventBuilder<'a> { macro_rules! event_builder_generic_impl { ($new_fn:expr) => { - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn seqnum(self, seqnum: Seqnum) -> Self { Self { builder: self.builder.seqnum(seqnum), @@ -924,7 +924,7 @@ macro_rules! event_builder_generic_impl { } } - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn running_time_offset(self, running_time_offset: i64) -> Self { Self { builder: self.builder.running_time_offset(running_time_offset), @@ -932,7 +932,7 @@ macro_rules! event_builder_generic_impl { } } - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self { Self { builder: self.builder.other_fields(other_fields), diff --git a/gstreamer/src/iterator.rs b/gstreamer/src/iterator.rs index 65c9c73c9..280293476 100644 --- a/gstreamer/src/iterator.rs +++ b/gstreamer/src/iterator.rs @@ -333,7 +333,7 @@ where let func = func as *const gobject_ffi::GValue; let func = gobject_ffi::g_value_get_boxed(func); - #[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] + #[allow(clippy::transmute_ptr_to_ref)] let func: &&(Fn(T) -> bool + Send + Sync + 'static) = mem::transmute(func); let value = &*(value as *const glib::Value); diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 3588610b6..715aabfad 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -59,11 +59,10 @@ macro_rules! skip_assert_initialized { pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; -#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] -#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] -#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] -#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] +#[allow(clippy::unreadable_literal)] +#[allow(clippy::too_many_arguments)] +#[allow(clippy::match_same_arms)] +#[allow(clippy::type_complexity)] #[rustfmt::skip] mod auto; pub use auto::functions::*; diff --git a/gstreamer/src/log.rs b/gstreamer/src/log.rs index fea015388..7d5a02a83 100644 --- a/gstreamer/src/log.rs +++ b/gstreamer/src/log.rs @@ -20,7 +20,7 @@ use glib::IsA; #[derive(PartialEq, Eq, Clone, Copy)] pub struct DebugCategory(ptr::NonNull); -#[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] +#[allow(clippy::trivially_copy_pass_by_ref)] impl DebugCategory { pub fn new<'a, P: Into>>( name: &str, diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 1fd60745c..bed9748a0 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -1187,7 +1187,7 @@ impl<'a> MessageBuilder<'a> { macro_rules! message_builder_generic_impl { ($new_fn:expr) => { - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn src + Cast + Clone>(self, src: Option<&O>) -> Self { Self { builder: self.builder.src(src), @@ -1195,7 +1195,7 @@ macro_rules! message_builder_generic_impl { } } - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn seqnum(self, seqnum: Seqnum) -> Self { Self { builder: self.builder.seqnum(seqnum), @@ -1204,7 +1204,7 @@ macro_rules! message_builder_generic_impl { } #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] + #[allow(clippy::needless_update)] pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self { Self { builder: self.builder.other_fields(other_fields), @@ -2268,7 +2268,7 @@ pub struct RedirectBuilder<'a> { location: &'a str, tag_list: Option<&'a TagList>, entry_struct: Option, - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] entries: Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>, } #[cfg(any(feature = "v1_10", feature = "dox"))] diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index a949ec5d4..4b632ce8a 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -245,7 +245,7 @@ impl<'a, T: MiniObject + 'static> ToGlibPtrMut<'a, *mut T::GstType> for GstRc } impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstType> for GstRc { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] type Storage = ( Vec>>, Option>, @@ -296,7 +296,7 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *const *mut T::GstType> for GstRc { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] type Storage = ( Vec>>, Option>, @@ -607,7 +607,7 @@ macro_rules! gst_define_mini_object_wrapper( } impl<'a> $crate::glib::translate::ToGlibContainerFromSlice<'a, *mut *mut $ffi_name> for $name { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] type Storage = ( Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>, Option>, @@ -658,7 +658,7 @@ macro_rules! gst_define_mini_object_wrapper( impl<'a> $crate::glib::translate::ToGlibContainerFromSlice<'a, *const *mut $ffi_name> for $name { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] type Storage = ( Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>, Option>, @@ -844,7 +844,7 @@ macro_rules! gst_define_mini_object_wrapper( type Owned = $name; fn to_owned(&self) -> $name { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { $name($crate::glib::translate::from_glib_none($crate::miniobject::MiniObject::as_ptr(self))) } diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 8bafa099d..77da98bf5 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -516,7 +516,7 @@ impl> PadExtManual for O { where F: Fn(&Self, &Option<::Object>) -> Result<(), LoggableError> + Send + Sync + 'static, { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] unsafe { let func_box: Box = Box::new(func); ffi::gst_pad_set_activate_function_full( @@ -535,7 +535,7 @@ impl> PadExtManual for O { + Sync + 'static, { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] unsafe { let func_box: Box = Box::new(func); ffi::gst_pad_set_activatemode_function_full( @@ -1346,7 +1346,7 @@ unsafe extern "C" fn trampoline_pad_task(func: gpoi } fn into_raw_pad_task(func: F) -> gpointer { - #[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] + #[allow(clippy::type_complexity)] let func: Box> = Box::new(RefCell::new(func)); Box::into_raw(func) as gpointer } diff --git a/gstreamer/src/segment.rs b/gstreamer/src/segment.rs index c703fb886..b82052f93 100644 --- a/gstreamer/src/segment.rs +++ b/gstreamer/src/segment.rs @@ -131,7 +131,7 @@ impl FormattedSegment { } } - #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] + #[allow(clippy::too_many_arguments)] pub fn do_seek>( &mut self, rate: f64, @@ -367,7 +367,7 @@ impl FormattedSegment { self.0.rate } - #[cfg_attr(feature = "cargo-clippy", allow(float_cmp))] + #[allow(clippy::float_cmp)] pub fn set_rate(&mut self, rate: f64) { assert_ne!(rate, 0.0); self.0.rate = rate; @@ -377,7 +377,7 @@ impl FormattedSegment { self.0.applied_rate } - #[cfg_attr(feature = "cargo-clippy", allow(float_cmp))] + #[allow(clippy::float_cmp)] pub fn set_applied_rate(&mut self, applied_rate: f64) { assert_ne!(applied_rate, 0.0); self.0.applied_rate = applied_rate; diff --git a/gstreamer/src/subclass/error.rs b/gstreamer/src/subclass/error.rs index 44e0ce90d..19b991677 100644 --- a/gstreamer/src/subclass/error.rs +++ b/gstreamer/src/subclass/error.rs @@ -20,7 +20,7 @@ macro_rules! gst_panic_to_error( use std::sync::atomic::Ordering; use $crate::ElementExtManual; - #[cfg_attr(feature = "cargo-clippy", allow(unused_unit))] + #[allow(clippy::unused_unit)] { if $panicked.load(Ordering::Relaxed) { $element.post_error_message(&gst_error_msg!($crate::LibraryError::Failed, ["Panicked"])); diff --git a/gstreamer/src/subclass/mod.rs b/gstreamer/src/subclass/mod.rs index 088ceb7cf..892627575 100644 --- a/gstreamer/src/subclass/mod.rs +++ b/gstreamer/src/subclass/mod.rs @@ -6,7 +6,7 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] +#![allow(clippy::cast_ptr_alignment)] #[macro_use] pub mod error; diff --git a/gstreamer/src/utils.rs b/gstreamer/src/utils.rs index a7ef46a0d..6ee68c29a 100644 --- a/gstreamer/src/utils.rs +++ b/gstreamer/src/utils.rs @@ -12,7 +12,7 @@ use glib_ffi; pub struct MutexGuard<'a>(&'a glib_ffi::GMutex); impl<'a> MutexGuard<'a> { - #[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] + #[allow(clippy::trivially_copy_pass_by_ref)] pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self { unsafe { glib_ffi::g_mutex_lock(mut_override(mutex)); diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index 1825459db..8734a9ebb 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -565,7 +565,7 @@ impl<'a> FromValue<'a> for Array<'a> { if arr.is_null() { Array(Cow::Borrowed(&[])) } else { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] Array(Cow::Borrowed(slice::from_raw_parts( (*arr).data as *const glib::SendValue, (*arr).len as usize, @@ -643,7 +643,7 @@ impl<'a> FromValue<'a> for List<'a> { if arr.is_null() { List(Cow::Borrowed(&[])) } else { - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] List(Cow::Borrowed(slice::from_raw_parts( (*arr).data as *const glib::SendValue, (*arr).len as usize, diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index 8c775ffc9..9669c3f95 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -221,7 +221,7 @@ mod tutorial5 { ) -> *mut c_void; } - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _); video_overlay.set_window_handle(xid as usize); @@ -238,7 +238,7 @@ mod tutorial5 { ) -> *mut c_void; } - #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] + #[allow(clippy::cast_ptr_alignment)] unsafe { let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _); video_overlay.set_window_handle(window as usize);