Hash the length of the RingBuf before hashing elements

This commit is contained in:
nham 2014-07-27 12:37:32 -04:00
parent 6361577808
commit 9fa4424b71

View file

@ -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);
}