smol-bytes 0.1.7

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
16
17
18
use std::{
  boxed::Box,
  string::{String, ToString},
};

use super::*;

impl ::quickcheck::Arbitrary for Utf8BytesMut {
  fn arbitrary(g: &mut ::quickcheck::Gen) -> Self {
    let s = String::arbitrary(g);
    Self::from(s)
  }

  fn shrink(&self) -> Box<dyn Iterator<Item = Self>> {
    let s = self.as_str().to_string();
    Box::new(s.shrink().map(Self::from))
  }
}