orx_funvec/d2/
into_index.rs

1use crate::index::{FromIndex, IntoIndex};
2
3const DIM: usize = 2;
4type Tuple = (usize, usize);
5
6impl IntoIndex<DIM> for Tuple {
7    #[inline(always)]
8    fn into_index(self) -> [usize; DIM] {
9        [self.0, self.1]
10    }
11}
12
13impl FromIndex<DIM> for Tuple {
14    #[inline(always)]
15    fn from_index(index: [usize; DIM]) -> Self {
16        (index[0], index[1])
17    }
18}