Skip to content

Commit

Permalink
Add BuildHasher example
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 22, 2016
1 parent e7c822c commit 8907060
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libcore/hash/mod.rs
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8907060

Please sign in to comment.