mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-25 13:36:37 +00:00
Function to get index from SoA slice
This commit is contained in:
parent
f0b017b807
commit
c8de1e5a27
1 changed files with 4 additions and 0 deletions
|
|
@ -137,6 +137,10 @@ impl<T> Slice<T> {
|
|||
pub fn into_iter(&self) -> impl Iterator<Item = Index<T>> {
|
||||
self.indices().map(|i| Index::new(i as _))
|
||||
}
|
||||
|
||||
pub const fn at(&self, i: usize) -> Index<T> {
|
||||
Index::new(self.start + i as u32)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue