diff options
| author | nham <hamann.nick@gmail.com> | 2014-07-27 12:37:32 -0400 |
|---|---|---|
| committer | nham <hamann.nick@gmail.com> | 2014-07-27 12:37:32 -0400 |
| commit | 9fa4424b71c1e8a0616e82a34f406a109dffe685 (patch) | |
| tree | 8fe5786b47e99bafd66d426b6b61dc0849165db8 | |
| parent | 63615778089545588ed15b7467bb3cca1c05c3a7 (diff) | |
| download | rust-9fa4424b71c1e8a0616e82a34f406a109dffe685.tar.gz rust-9fa4424b71c1e8a0616e82a34f406a109dffe685.zip | |
Hash the length of the RingBuf before hashing elements
| -rw-r--r-- | src/libcollections/ringbuf.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcollections/ringbuf.rs b/src/libcollections/ringbuf.rs index 6b1670fbe85..44b546f6656 100644 --- a/src/libcollections/ringbuf.rs +++ b/src/libcollections/ringbuf.rs @@ -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); } |
