Expand description
Get the index of a subslice into its parent slice.
§Example
use subslice_index::subslice_index;
let arr = [1, 2, 3, 4, 5, 6];
let slice = &arr[..];
let subslice = &slice[2..4];
assert_eq!(subslice, [3, 4]);
assert_eq!(subslice_index(slice, subslice), 2);
Functions§
- subslice_
index - Get the index into the given slice of the first item in the given subslice.