From be8ff5d0e1601ad503daad2f3ace59eaa98e7dd0 Mon Sep 17 00:00:00 2001 From: Nicola Papale Date: Wed, 11 Oct 2023 16:43:17 +0200 Subject: [PATCH] Extract common wireframe filters in type alias (#10080) # Objective - The filter type on the `apply_global_wireframe_material` system had duplicate filter code and the `clippy::type_complexity` attribute. ## Solution - Extract the common part of the filter into a type alias --- crates/bevy_pbr/src/wireframe.rs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/crates/bevy_pbr/src/wireframe.rs b/crates/bevy_pbr/src/wireframe.rs index 5aff6e4df9..a0cee2abd7 100644 --- a/crates/bevy_pbr/src/wireframe.rs +++ b/crates/bevy_pbr/src/wireframe.rs @@ -108,29 +108,14 @@ fn apply_wireframe_material( commands.insert_or_spawn_batch(wireframes_to_spawn); } +type WireframeFilter = (With>, Without, Without); + /// Applies or removes a wireframe material on any mesh without a [`Wireframe`] component. -#[allow(clippy::type_complexity)] fn apply_global_wireframe_material( mut commands: Commands, config: Res, - meshes_without_material: Query< - Entity, - ( - With>, - Without, - Without, - Without>, - ), - >, - meshes_with_global_material: Query< - Entity, - ( - With>, - Without, - Without, - With>, - ), - >, + meshes_without_material: Query>)>, + meshes_with_global_material: Query>)>, global_material: Res, ) { if !config.is_changed() {