From 7f285cc42990e34bd8a489519aaae216a93584cf Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Sun, 19 May 2019 23:12:57 +0100 Subject: [PATCH] Fix UnknownFields hash (Previously always returned 0) --- protobuf/src/unknown.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf/src/unknown.rs b/protobuf/src/unknown.rs index 85b1a6c43..2f215b25e 100644 --- a/protobuf/src/unknown.rs +++ b/protobuf/src/unknown.rs @@ -149,7 +149,7 @@ impl Hash for UnknownFields { for (k, v) in &**map { let mut entry_hasher = DefaultHasher::new(); Hash::hash(&(k, v), &mut entry_hasher); - hash.wrapping_add(entry_hasher.finish()); + hash = hash.wrapping_add(entry_hasher.finish()); } Hash::hash(&hash, state); }