Macro arrutil::split_to_array_scan [] [src]

macro_rules! split_to_array_scan {
    ($source:expr, $len:expr) => { ... };
}

You can use split_to_array_scan to turn a slice into a reference to an array while mutating the original slice.

Internally, it has the signature

fn split_to_array_scan<'a, T>(source: &mut &'a [T]) -> Option<&'a [T; N]>

Externally, it should be seen as having the signature

slice_to_array_scan!(source: &mut &[T], len: N) -> Option<&[T; N]>

Where N is an integer literal and a valid array length.

Returns None when length is longer than slice.

There is no mutable version of this function availble. If someone wants to figure out the correct way to set one up that the compiler is happy please send a pull request.