memberlist_proto/compression/quickcheck_impl.rs
1use super::{BrotliAlgorithm, ZstdCompressionLevel};
2use quickcheck::{Arbitrary, Gen};
3
4impl Arbitrary for ZstdCompressionLevel {
5 fn arbitrary(g: &mut Gen) -> Self {
6 let level = i8::arbitrary(g);
7 ZstdCompressionLevel::from(level)
8 }
9}
10
11impl Arbitrary for BrotliAlgorithm {
12 fn arbitrary(g: &mut Gen) -> Self {
13 let val = u8::arbitrary(g);
14 BrotliAlgorithm::decode(val)
15 }
16}