pub fn slice_offsets(
offset: i64,
length: usize,
array_len: usize,
) -> (usize, usize)Expand description
Resolves a slice with a possibly negative offset against an array of length
array_len, returning the clamped start index and length.