Function text_analysis::get_index_max[][src]

pub fn get_index_max(index: &usize, max_len: &usize) -> usize
Expand description

Get maximum index and garantee that index does not exeed total length of Vec

Example

#[test]
fn test() {
use text_analysis::get_index_max;
let index1 = 5;
let max_index1 = get_index_max(&index1, &9).unwrap();
assert_eq!(max_index1, 9);
}