Sha256: aa6c7e6e7cf4afcb207fa43f1edf95dd3ec4d78cc5fe86bf40a8b98b116d5f0f

Contents?: true

Size: 623 Bytes

Versions: 3

Compression:

Stored size: 623 Bytes

Contents

use {
    crate::{Arbitrary, Result, Unstructured},
    std::{
        collections::hash_map::HashMap,
        hash::{BuildHasher, Hash},
    },
};

impl<'a, K, V, S> Arbitrary<'a> for HashMap<K, V, S>
where
    K: Arbitrary<'a> + Eq + Hash,
    V: Arbitrary<'a>,
    S: BuildHasher + Default,
{
    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
        u.arbitrary_iter()?.collect()
    }

    fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self> {
        u.arbitrary_take_rest_iter()?.collect()
    }

    #[inline]
    fn size_hint(_depth: usize) -> (usize, Option<usize>) {
        (0, None)
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/arbitrary-1.4.1/src/foreign/std/collections/hash_map.rs
wasmtime-28.0.0 ./ext/cargo-vendor/arbitrary-1.4.1/src/foreign/std/collections/hash_map.rs
wasmtime-27.0.0 ./ext/cargo-vendor/arbitrary-1.4.1/src/foreign/std/collections/hash_map.rs