(&self, start: usize, end: usize)
| 547 | |
| 548 | #[inline(always)] |
| 549 | pub fn sub_slice(&self, start: usize, end: usize) -> Result<&[u8], Error> { |
| 550 | // Allow start == bf.len() when end == bf.len() to support empty slices at buffer end |
| 551 | if start > self.bf.len() || end > self.bf.len() || end < start { |
| 552 | Err(Error::buffer_out_of_bound( |
| 553 | start, |
| 554 | self.bf.len(), |
| 555 | self.bf.len(), |
| 556 | )) |
| 557 | } else { |
| 558 | Ok(&self.bf[start..end]) |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | #[inline(always)] |
| 563 | pub fn slice_after_cursor(&self) -> &[u8] { |
no test coverage detected