implement Debug for Flags regardless of underlying type (#1323)

This commit is contained in:
Jakob Hellermann 2021-01-26 20:58:46 +01:00 committed by GitHub
parent 528c2858e0
commit f3306e5490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,13 +131,22 @@ impl<T: WorldQuery> WorldQuery for Option<T> {
}
/// Flags on component `T` that happened since the start of the frame.
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct Flags<T: Component> {
_marker: std::marker::PhantomData<T>,
with: bool,
added: bool,
mutated: bool,
}
impl<T: Component> std::fmt::Debug for Flags<T> {
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<T: Component> Flags<T> {
/// Does the entity have this component