@@ -1,5 +1,4 @@
11use std::cell::Cell;
2−use std::convert::identity;
32use std::ops::Range;
43use std::rc::Rc;
54
@@ -113,9 +112,7 @@ impl<A, M> Layer<A, M> {
113112 pub fn reset_pos(&self, char_idx: usize, get_char_idx: impl Fn(&A) -> usize) {
114113 let new_index = self
115114 .annotations
116− .binary_search_by_key(&char_idx, get_char_idx)
117− .unwrap_or_else(identity);
118−
115+ .partition_point(|annot| get_char_idx(annot) < char_idx);
119116 self.current_index.set(new_index);
120117 }
121118