From 5c4d4868b0d13d02234c39a2b21baa358199fb0b Mon Sep 17 00:00:00 2001 From: plof27 Date: Mon, 27 Jun 2022 18:15:48 -0400 Subject: [PATCH] Run cargo fmt and cargo clippy --- crates/bevy_ecs/src/world/archetype_invariants.rs | 11 ++++++----- crates/bevy_ecs/src/world/mod.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/bevy_ecs/src/world/archetype_invariants.rs b/crates/bevy_ecs/src/world/archetype_invariants.rs index b5f49fe6393522..b2f88b256dd326 100644 --- a/crates/bevy_ecs/src/world/archetype_invariants.rs +++ b/crates/bevy_ecs/src/world/archetype_invariants.rs @@ -98,7 +98,9 @@ impl ArchetypeStatement { } UntypedArchetypeStatement::AtLeastOneOf(component_ids) } - ArchetypeStatement::AtMostOneOf(_) => UntypedArchetypeStatement::AtMostOneOf(component_ids), + ArchetypeStatement::AtMostOneOf(_) => { + UntypedArchetypeStatement::AtMostOneOf(component_ids) + } ArchetypeStatement::NoneOf(_) => UntypedArchetypeStatement::NoneOf(component_ids), } } @@ -129,7 +131,7 @@ impl ArchetypeStatement { } /// A type-erased version of [`ArchetypeInvariant`]. -/// +/// /// Intended to be used with dynamic components that cannot be represented with Rust types. /// Prefer [`ArchetypeInvariant`] when possible. #[derive(Clone, Debug, PartialEq)] @@ -215,10 +217,9 @@ impl UntypedArchetypeStatement { for exclusive_id in exclusive_ids { if component_ids.contains(exclusive_id) { if found_previous { - return false - } else { - found_previous = true; + return false; } + found_previous = true; } } true diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index b25104904c47a7..813e5a4c0977a9 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -663,7 +663,7 @@ impl World { archetype_invariant: ArchetypeInvariant, ) { let untyped_invariant = archetype_invariant.into_untyped(self); - + for archetype in &self.archetypes.archetypes { let components = archetype.components.indices(); untyped_invariant.test_archetype(components);