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:
parent
ece6249830
commit
1619d42e78
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user