use crate::{HashMap, HashSet, OrdMap, OrdSet, Vector}; use ::quickcheck::{Arbitrary, Gen}; use std::hash::{BuildHasher, Hash}; use std::iter::FromIterator; impl Arbitrary for Vector { fn arbitrary(g: &mut Gen) -> Self { Vector::from_iter(Vec::::arbitrary(g)) } } impl Arbitrary for OrdMap { fn arbitrary(g: &mut Gen) -> Self { OrdMap::from_iter(Vec::<(K, V)>::arbitrary(g)) } } impl Arbitrary for OrdSet { fn arbitrary(g: &mut Gen) -> Self { OrdSet::from_iter(Vec::::arbitrary(g)) } } impl Arbitrary for HashSet where A: Hash + Eq + Arbitrary + Sync, S: BuildHasher + Default + Send + Sync + 'static, { fn arbitrary(g: &mut Gen) -> Self { HashSet::from_iter(Vec::::arbitrary(g)) } } impl Arbitrary for HashMap where K: Hash + Eq + Arbitrary + Sync, V: Arbitrary + Sync, S: BuildHasher + Default + Send + Sync + 'static, { fn arbitrary(g: &mut Gen) -> Self { HashMap::from(Vec::<(K, V)>::arbitrary(g)) } }