Add Debug to Has Query type (#12722)

# Objective

Pretty minor change to add `Debug` to `Has`.

This is helpful for users (Like me) who have the
[`missing_debug_implementations`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_lint/builtin/static.MISSING_DEBUG_IMPLEMENTATIONS.html)
lint turned on.

## Solution

Simple `#[derive(Debug)]`

## Changelog
* Has now implemented `Debug`
This commit is contained in:
Testare 2024-03-28 11:31:50 -07:00 committed by GitHub
parent ece6249830
commit 1619d42e78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1410,6 +1410,12 @@ unsafe impl<T: ReadOnlyQueryData> ReadOnlyQueryData for Option<T> {}
/// ```
pub struct Has<T>(PhantomData<T>);
impl<T> std::fmt::Debug for Has<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "Has<{}>", std::any::type_name::<T>())
}
}
/// SAFETY:
/// `update_component_access` and `update_archetype_component_access` do nothing.
/// This is sound because `fetch` does not access components.