brood/archetypes/
impl_debug.rs

1use crate::{
2    archetypes::Archetypes,
3    registry,
4};
5use core::{
6    fmt,
7    fmt::Debug,
8};
9
10impl<R> Debug for Archetypes<R>
11where
12    R: registry::Debug,
13{
14    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15        f.debug_map()
16            .entries(self.iter().map(|archetype| {
17                (
18                    // SAFETY: The `IdentifierRef` obtained here does not live longer than the
19                    // `archetype`.
20                    unsafe { archetype.identifier() },
21                    archetype,
22                )
23            }))
24            .finish()
25    }
26}