bevy_winit: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
(#17232)
# 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_winit` in line with the new restrictions. ## Testing `cargo clippy --tests` was run, and no errors were encountered. --------- Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
This commit is contained in:
parent
532bb15489
commit
2403487239
@ -1,5 +1,10 @@
|
|||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
#![forbid(unsafe_code)]
|
#![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(
|
#![doc(
|
||||||
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
||||||
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
||||||
|
@ -42,7 +42,6 @@ use crate::{
|
|||||||
///
|
///
|
||||||
/// If any of these entities are missing required components, those will be added with their
|
/// If any of these entities are missing required components, those will be added with their
|
||||||
/// default values.
|
/// default values.
|
||||||
#[allow(clippy::too_many_arguments)]
|
|
||||||
pub fn create_windows<F: QueryFilter + 'static>(
|
pub fn create_windows<F: QueryFilter + 'static>(
|
||||||
event_loop: &ActiveEventLoop,
|
event_loop: &ActiveEventLoop,
|
||||||
(
|
(
|
||||||
@ -203,7 +202,10 @@ pub fn create_monitors(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(
|
||||||
|
clippy::too_many_arguments,
|
||||||
|
reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be."
|
||||||
|
)]
|
||||||
pub(crate) fn despawn_windows(
|
pub(crate) fn despawn_windows(
|
||||||
closing: Query<Entity, With<ClosingWindow>>,
|
closing: Query<Entity, With<ClosingWindow>>,
|
||||||
mut closed: RemovedComponents<Window>,
|
mut closed: RemovedComponents<Window>,
|
||||||
|
@ -43,7 +43,10 @@ pub struct WinitWindows {
|
|||||||
|
|
||||||
impl WinitWindows {
|
impl WinitWindows {
|
||||||
/// Creates a `winit` window and associates it with our entity.
|
/// Creates a `winit` window and associates it with our entity.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[expect(
|
||||||
|
clippy::too_many_arguments,
|
||||||
|
reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be."
|
||||||
|
)]
|
||||||
pub fn create_window(
|
pub fn create_window(
|
||||||
&mut self,
|
&mut self,
|
||||||
event_loop: &ActiveEventLoop,
|
event_loop: &ActiveEventLoop,
|
||||||
@ -243,7 +246,11 @@ impl WinitWindows {
|
|||||||
winit_window_attributes.with_min_inner_size(min_inner_size)
|
winit_window_attributes.with_min_inner_size(min_inner_size)
|
||||||
};
|
};
|
||||||
|
|
||||||
#[allow(unused_mut)]
|
#[expect(clippy::allow_attributes, reason = "`unused_mut` is not always linted")]
|
||||||
|
#[allow(
|
||||||
|
unused_mut,
|
||||||
|
reason = "This variable needs to be mutable if `cfg(target_arch = \"wasm32\")`"
|
||||||
|
)]
|
||||||
let mut winit_window_attributes = winit_window_attributes.with_title(window.title.as_str());
|
let mut winit_window_attributes = winit_window_attributes.with_title(window.title.as_str());
|
||||||
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
Loading…
Reference in New Issue
Block a user