I'm using quickcheck and would like to implement quickcheck::Arbitrary
for a struct. This trait has to exist in the same file/crate that the struct is defined, but I don't want it in the release binary.
pub struct c_struct {
pub i64_: i64,
pub u64_: u64,
pub u32_: u32,
}
// #[cfg(test)] does not work
impl quickcheck::Arbitrary for c_struct {
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> c_struct {
c_struct {
i64_: i64::arbitrary(g),
u64_: u64::arbitrary(g),
u32_: u32::arbitrary(g),
}
}
}