Add RocList from array

This commit is contained in:
Ayaz Hafiz 2022-08-17 17:58:03 -05:00
parent b1e41a5995
commit f70993c2a3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 24 additions and 0 deletions

View file

@ -483,6 +483,12 @@ where
}
}
impl<T, const SIZE: usize> From<[T; SIZE]> for RocList<T> {
fn from(array: [T; SIZE]) -> Self {
Self::from_iter(array)
}
}
impl<'a, T> IntoIterator for &'a RocList<T> {
type Item = &'a T;
type IntoIter = core::slice::Iter<'a, T>;