std.array.bounds_check
Show source codeHide source code
fn pub inline bounds_check(index: Int, size: Int) {
if index < 0 or index >= size { out_of_bounds(index, size) }
}
fn pub inline static bounds_check(index: Int, size: Int)
Checks if index
is in the range of zero up to (but excluding) size
.
Panics
This method panics if the index is out of bounds.