From 53077b9316c87565a973655b902b22227a62af23 Mon Sep 17 00:00:00 2001 From: MichiRecRoom <1008889+LikeLakers2@users.noreply.github.com> Date: Thu, 9 Jan 2025 01:25:45 -0500 Subject: [PATCH] bevy_gilrs: Apply `#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` (#17245) # Objective - https://github.com/bevyengine/bevy/issues/17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_gilrs` in line with the new restrictions. ## Testing `cargo clippy --tests --package bevy_gilrs` was run, and no errors were encountered. --- crates/bevy_gilrs/src/lib.rs | 5 +++++ crates/bevy_gilrs/src/rumble.rs | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/bevy_gilrs/src/lib.rs b/crates/bevy_gilrs/src/lib.rs index b8d83adbf3..7b6881a3ed 100644 --- a/crates/bevy_gilrs/src/lib.rs +++ b/crates/bevy_gilrs/src/lib.rs @@ -1,5 +1,10 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![forbid(unsafe_code)] +#![deny( + clippy::allow_attributes, + clippy::allow_attributes_without_reason, + reason = "See #17111; To be removed once all crates are in-line with these attributes" +)] #![doc( html_logo_url = "https://bevyengine.org/assets/icon.png", html_favicon_url = "https://bevyengine.org/assets/icon.png" diff --git a/crates/bevy_gilrs/src/rumble.rs b/crates/bevy_gilrs/src/rumble.rs index bc18aec18b..e0fdff62d8 100644 --- a/crates/bevy_gilrs/src/rumble.rs +++ b/crates/bevy_gilrs/src/rumble.rs @@ -21,7 +21,10 @@ struct RunningRumble { /// A ref-counted handle to the specific force-feedback effect /// /// Dropping it will cause the effect to stop - #[allow(dead_code)] + #[expect( + dead_code, + reason = "We don't need to read this field, as its purpose is to keep the rumble effect going until the field is dropped." + )] effect: SyncCell, }