Hash the length of the RingBuf before hashing elements
This commit is contained in:
parent
6361577808
commit
9fa4424b71
1 changed files with 1 additions and 0 deletions
|
|
@ -460,6 +460,7 @@ impl<A: PartialOrd> PartialOrd for RingBuf<A> {
|
|||
|
||||
impl<S: Writer, A: Hash<S>> Hash<S> for RingBuf<A> {
|
||||
fn hash(&self, state: &mut S) {
|
||||
self.len().hash(state);
|
||||
for elt in self.iter() {
|
||||
elt.hash(state);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue