ordinal-map 0.1.10

Ordinal trait to map values to integers and efficient maps and sets for such types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::array_builder::ArrayBuilder;

pub(crate) fn array_as_mut<T, const S: usize>(array: &mut [T; S]) -> [&mut T; S] {
    let mut array: &mut [T] = array;

    let mut result = ArrayBuilder::new();
    while let Some((first, rest)) = array.split_first_mut() {
        result.push(first);
        array = rest;
    }
    result.finish()
}