Skip to content

Commit 5b0406c

Browse files
authored
bevy_color: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17090)
# Objective - #17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_audio` in line with the new restrictions. No code changes have been made - except if a lint that was previously `allow(...)`'d could be removed via small code changes. For example, `unused_variables` can be handled by adding a `_` to the beginning of a field's name. ## Testing I ran `cargo clippy`, and received no errors.
1 parent 4fde223 commit 5b0406c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

crates/bevy_color/src/lib.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3+
#![deny(
4+
clippy::allow_attributes,
5+
clippy::allow_attributes_without_reason,
6+
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7+
)]
38
#![doc(
49
html_logo_url = "https://bevyengine.org/assets/icon.png",
510
html_favicon_url = "https://bevyengine.org/assets/icon.png"
@@ -145,7 +150,14 @@ pub use srgba::*;
145150
pub use xyza::*;
146151

147152
/// Describes the traits that a color should implement for consistency.
148-
#[allow(dead_code)] // This is an internal marker trait used to ensure that our color types impl the required traits
153+
#[expect(
154+
clippy::allow_attributes,
155+
reason = "If the below attribute on `dead_code` is removed, then rustc complains that `StandardColor` is dead code. However, if we `expect` the `dead_code` lint, then rustc complains of an unfulfilled expectation."
156+
)]
157+
#[allow(
158+
dead_code,
159+
reason = "This is an internal marker trait used to ensure that our color types impl the required traits"
160+
)]
149161
pub(crate) trait StandardColor
150162
where
151163
Self: core::fmt::Debug,

crates/bevy_color/src/palettes/css.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use crate::Srgba;
55

66
// The CSS4 colors are a superset of the CSS1 colors, so we can just re-export the CSS1 colors.
7-
#[allow(unused_imports)]
87
pub use crate::palettes::basic::*;
98

109
/// <div style="background-color:rgb(94.1%, 97.3%, 100.0%); width: 10px; padding: 10px; border: 1px solid;"></div>

0 commit comments

Comments
 (0)