Skip to content

Commit e074899

Browse files
newAMeldruin
authored andcommitted
hashers: impl Clone
This follows the C-COMMON-TRAITS guidelines, and aligns with std::hash::DefaultHasher.
1 parent c59ede7 commit e074899

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

1212
- Added `Debug` implementations to hashers.
13+
- Added `Clone` implementations to hashers.
1314

1415
### Changed
1516

src/fnv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const PRIME: u32 = 0x1000193;
88
/// Specifically this implements the [FNV-1a hash].
99
///
1010
/// [FNV-1a hash]: https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash
11-
#[derive(Debug)]
11+
#[derive(Debug, Clone)]
1212
pub struct FnvHasher {
1313
state: u32,
1414
}

src/murmur3.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use core::slice;
44
use crate::Hasher as _;
55

66
/// 32-bit `MurmurHash3` hasher
7-
#[derive(Debug)]
7+
#[derive(Debug, Clone)]
88
pub struct Murmur3Hasher {
99
buf: Buffer,
1010
index: Index,
1111
processed: u32,
1212
state: State,
1313
}
1414

15-
#[derive(Debug)]
15+
#[derive(Debug, Clone)]
1616
struct State(u32);
1717

1818
#[derive(Debug, Clone, Copy)]

0 commit comments

Comments
 (0)