Searched refs:normalize_index (Results 1 – 1 of 1) sorted by relevance
/external/rust/crates/pest/src/ |
D | parser_state.rs | 1121 let start_norm = normalize_index(start, len)?; in constrain_idxs() 1122 let end_norm = end.map_or(Some(len), |e| normalize_index(e, len))?; in constrain_idxs() 1128 fn normalize_index(i: i32, len: usize) -> Option<usize> { in normalize_index() function 1149 assert_eq!(normalize_index(4, 6), Some(4)); in normalize_index_pos() 1150 assert_eq!(normalize_index(5, 5), Some(5)); in normalize_index_pos() 1151 assert_eq!(normalize_index(6, 3), None); in normalize_index_pos() 1156 assert_eq!(normalize_index(-4, 6), Some(2)); in normalize_index_neg() 1157 assert_eq!(normalize_index(-5, 5), Some(0)); in normalize_index_neg() 1158 assert_eq!(normalize_index(-6, 3), None); in normalize_index_neg()
|