smol-bytes 0.1.5

High-performance, clone-efficient byte buffers optimized for small data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::ops::Index;

use super::*;

impl<I> Index<I> for Utf8Buffer
where
  I: core::slice::SliceIndex<str>,
{
  type Output = I::Output;

  #[cfg_attr(not(coverage), inline(always))]
  fn index(&self, index: I) -> &Self::Output {
    &self.as_str()[index]
  }
}