Skip to content

Commit

Permalink
Auto merge of #11 - Manishearth:with-key, r=Ms2ger
Browse files Browse the repository at this point in the history
Add FnvHasher::with_key()

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-fnv/11)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jul 14, 2016
2 parents bee21c4 + cfd612c commit 65c1c07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fnv"
version = "1.0.3"
version = "1.0.4"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
description = "Fowler–Noll–Vo hash function"
license = "Apache-2.0 / MIT"
Expand Down
10 changes: 9 additions & 1 deletion lib.rs
Expand Up @@ -78,8 +78,16 @@ impl Default for FnvHasher {
}
}

impl Hasher for FnvHasher {
impl FnvHasher {
/// Create an FNV hasher starting with a state corresponding
/// to the hash `key`.
#[inline]
pub fn with_key(key: u64) -> FnvHasher {
FnvHasher(key)
}
}

impl Hasher for FnvHasher {
#[inline]
fn finish(&self) -> u64 {
self.0
Expand Down

0 comments on commit 65c1c07

Please sign in to comment.