diff --git a/src/ecs/archetype.rs b/src/ecs/archetype.rs index fc36fca..179ce71 100644 --- a/src/ecs/archetype.rs +++ b/src/ecs/archetype.rs @@ -38,7 +38,18 @@ impl FromIterator for Archetype where T: Into, { + #[inline] fn from_iter>(iter: I) -> Self { Self::new(iter) } } + +impl IntoIterator for Archetype { + type Item = Component; + type IntoIter = std::vec::IntoIter; + + #[inline] + fn into_iter(self) -> Self::IntoIter { + self.components.into_iter() + } +}