impl IntoIterator for Archetype

main
copygirl 1 month ago
parent 5343355a46
commit 6d4921dbbe
  1. 11
      src/ecs/archetype.rs

@ -38,7 +38,18 @@ impl<T> FromIterator<T> for Archetype
where where
T: Into<Component>, T: Into<Component>,
{ {
#[inline]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self { fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
Self::new(iter) Self::new(iter)
} }
} }
impl IntoIterator for Archetype {
type Item = Component;
type IntoIter = std::vec::IntoIter<Self::Item>;
#[inline]
fn into_iter(self) -> Self::IntoIter {
self.components.into_iter()
}
}

Loading…
Cancel
Save