From f3306e5490676f1ccb5894633b445fe35176b429 Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Tue, 26 Jan 2021 20:58:46 +0100 Subject: [PATCH] implement Debug for Flags regardless of underlying type (#1323) --- crates/bevy_ecs/src/core/query.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/core/query.rs b/crates/bevy_ecs/src/core/query.rs index d3d3e53fb6..d4bac85f9a 100644 --- a/crates/bevy_ecs/src/core/query.rs +++ b/crates/bevy_ecs/src/core/query.rs @@ -131,13 +131,22 @@ impl WorldQuery for Option { } /// Flags on component `T` that happened since the start of the frame. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Flags { _marker: std::marker::PhantomData, with: bool, added: bool, mutated: bool, } +impl std::fmt::Debug for Flags { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Flags") + .field("with", &self.with) + .field("added", &self.added) + .field("mutated", &self.mutated) + .finish() + } +} impl Flags { /// Does the entity have this component