pub fn check_bounds(i: usize, len: usize)
Expand description

境界チェックを行う。

Examples

use nekolib::utils::check_bounds;

let a = [0, 1, 2];
check_bounds(2, a.len());
use nekolib::utils::check_bounds;

let a = [0, 1, 2];
// panicked at 'index out of bounds: the len is 3 but the index is 3'
check_bounds(3, a.len());