Skip to content

Commit 10be6e6

Browse files
authored
Rollup merge of #34976 - GuillaumeGomez:build_hasher_doc, r=steveklabnik
Add BuildHasher example r? @steveklabnik
2 parents 33ad705 + 8907060 commit 10be6e6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libcore/hash/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,16 @@ pub trait BuildHasher {
234234
type Hasher: Hasher;
235235

236236
/// Creates a new hasher.
237+
///
238+
/// # Examples
239+
///
240+
/// ```
241+
/// use std::collections::hash_map::RandomState;
242+
/// use std::hash::BuildHasher;
243+
///
244+
/// let s = RandomState::new();
245+
/// let new_s = s.build_hasher();
246+
/// ```
237247
#[stable(since = "1.7.0", feature = "build_hasher")]
238248
fn build_hasher(&self) -> Self::Hasher;
239249
}

0 commit comments

Comments
 (0)