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
use super::*;

impl<'a> ::arbitrary::Arbitrary<'a> for Utf8Buffer {
  fn arbitrary(u: &mut ::arbitrary::Unstructured<'a>) -> ::arbitrary::Result<Self> {
    let s = <&str as ::arbitrary::Arbitrary>::arbitrary(u)?;
    Self::try_from_str(s).map_err(|_| ::arbitrary::Error::IncorrectFormat)
  }

  fn size_hint(depth: usize) -> (usize, Option<usize>) {
    <&str as ::arbitrary::Arbitrary>::size_hint(depth)
  }
}