use quickcheck::{Arbitrary, Gen}; #[derive(Debug, Clone)] pub struct OneMore { pub vec: Vec, pub x: u16, } impl Arbitrary for OneMore { fn arbitrary(g: &mut Gen) -> Self { let vec = Vec::::arbitrary(g); let x = loop { let x = u16::arbitrary(g); if vec.contains(&x) { continue; } break x; }; Self { vec, x } } } #[derive(Debug, Clone)] pub struct TwoVec { pub vec1: Vec, pub vec2: Vec, } impl Arbitrary for TwoVec { fn arbitrary(g: &mut Gen) -> Self { let vec1 = Vec::::arbitrary(g); let mut vec2 = Vec::::arbitrary(g); if vec2.is_empty() { vec2.push(u16::arbitrary(g)); } Self { vec1, vec2 } } }