From 9935a3ab5ff2cef8f2217b93a7039757f2a08c1f Mon Sep 17 00:00:00 2001 From: Tyler Herman-Hoyer Date: Wed, 3 Jul 2024 12:40:54 -0500 Subject: [PATCH] Derive Hash for EnumOrUnknown Since EnumOrUnknown does not have a protoc insertion point, additional derives cannot be added via the api. At the same time, EnumOrUnknown are simple values that are likely to be stored in a hash collection, such as a map or set. This single word commit adds the derive for the Hash trait to EnumOrUnknown. --- protobuf/src/enum_or_unknown.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf/src/enum_or_unknown.rs b/protobuf/src/enum_or_unknown.rs index d042fba39..1ffebe693 100644 --- a/protobuf/src/enum_or_unknown.rs +++ b/protobuf/src/enum_or_unknown.rs @@ -9,7 +9,7 @@ use crate::Enum; use crate::EnumFull; /// Protobuf enums with possibly unknown values are preserved in this struct. -#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)] +#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Hash)] #[repr(transparent)] // This should be when it no longer prevents using const fns. pub struct EnumOrUnknown {