(&self, start: usize, end: usize)
| 207 | } |
| 208 | |
| 209 | pub fn slice(&self, start: usize, end: usize) -> Option<RopeSlice<'_>> { |
| 210 | let start = start.min(self.len_chars()); |
| 211 | let end = end.min(self.len_chars()); |
| 212 | (start < end).then(|| self.rope.slice(start..end)) |
| 213 | } |
| 214 | |
| 215 | pub fn to_string(&self) -> String { |
| 216 | let mut text = String::with_capacity(self.rope.len_bytes()); |