bevy_tasks: Apply #[deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
(#17089)
# Objective We want to deny the following lints: * `clippy::allow_attributes` - Because there's no reason to `#[allow(...)]` an attribute if it wouldn't lint against anything; you should always use `#[expect(...)]` * `clippy::allow_attributes_without_reason` - Because documenting the reason for allowing/expecting a lint is always good ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_tasks` 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.
This commit is contained in:
parent
22bf3b9a62
commit
5a5ddb9e35
@ -50,6 +50,7 @@ pub struct LocalExecutor<'a>(LocalExecutorInner<'a>);
|
||||
|
||||
impl Executor<'_> {
|
||||
/// Construct a new [`Executor`]
|
||||
#[expect(clippy::allow_attributes, reason = "This lint may not always trigger.")]
|
||||
#[allow(dead_code, reason = "not all feature flags require this function")]
|
||||
pub const fn new() -> Self {
|
||||
Self(ExecutorInner::new())
|
||||
@ -58,6 +59,7 @@ impl Executor<'_> {
|
||||
|
||||
impl LocalExecutor<'_> {
|
||||
/// Construct a new [`LocalExecutor`]
|
||||
#[expect(clippy::allow_attributes, reason = "This lint may not always trigger.")]
|
||||
#[allow(dead_code, reason = "not all feature flags require this function")]
|
||||
pub const fn new() -> Self {
|
||||
Self(LocalExecutorInner::new())
|
||||
|
@ -5,6 +5,7 @@
|
||||
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
||||
)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
|
@ -694,7 +694,6 @@ where
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(clippy::disallowed_types)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use core::sync::atomic::{AtomicBool, AtomicI32, Ordering};
|
||||
|
Loading…
Reference in New Issue
Block a user