Rollup merge of #34976 - GuillaumeGomez:build_hasher_doc, r=steveklabnik

Add BuildHasher example

r? @steveklabnik
This commit is contained in:
Manish Goregaokar 2016-07-24 15:18:48 +05:30 committed by GitHub
commit 10be6e6c9e

View File

@ -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;
}