1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#![unstable(feature = "hashmap_hasher", reason = "hasher stuff is unclear",
issue = "27713")]
#![rustc_deprecated(since = "1.7.0", reason = "support moved to std::hash")]
#![allow(deprecated)]
use clone::Clone;
use default::Default;
use hash;
use marker;
pub use hash::HashState;
pub struct DefaultState<H>(marker::PhantomData<H>);
impl<H: Default + hash::Hasher> HashState for DefaultState<H> {
type Hasher = H;
fn hasher(&self) -> H { Default::default() }
}
impl<H> Clone for DefaultState<H> {
fn clone(&self) -> DefaultState<H> { DefaultState(marker::PhantomData) }
}
impl<H> Default for DefaultState<H> {
fn default() -> DefaultState<H> { DefaultState(marker::PhantomData) }
}