Add BuildHasher example
This commit is contained in:
parent
e7c822cee2
commit
890706070d
@ -234,6 +234,16 @@ pub trait BuildHasher {
|
||||
type Hasher: Hasher;
|
||||
|
||||
/// Creates a new hasher.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::hash_map::RandomState;
|
||||
/// use std::hash::BuildHasher;
|
||||
///
|
||||
/// let s = RandomState::new();
|
||||
/// let new_s = s.build_hasher();
|
||||
/// ```
|
||||
#[stable(since = "1.7.0", feature = "build_hasher")]
|
||||
fn build_hasher(&self) -> Self::Hasher;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user