From 64940f213d862ed3a8c7a52e1291e381d1cd6721 Mon Sep 17 00:00:00 2001 From: Colin Rofls Date: Wed, 14 Feb 2024 13:20:53 -0500 Subject: [PATCH] [icu_properties] Derive hash for property types (#4613) --- components/properties/src/props.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/components/properties/src/props.rs b/components/properties/src/props.rs index 5cfc84fa1c2..b7e29a0e883 100644 --- a/components/properties/src/props.rs +++ b/components/properties/src/props.rs @@ -647,7 +647,7 @@ macro_rules! impl_value_getter { /// These are the categories required by the Unicode Bidirectional Algorithm. /// For the property values, see [Bidirectional Class Values](https://unicode.org/reports/tr44/#Bidi_Class_Values). /// For more information, see [Unicode Standard Annex #9](https://unicode.org/reports/tr41/tr41-28.html#UAX9). -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -781,7 +781,7 @@ impl_value_getter! { /// /// GeneralCategory only supports specific subcategories (eg `UppercaseLetter`). /// It does not support grouped categories (eg `Letter`). For grouped categories, use [`GeneralCategoryGroup`]. -#[derive(Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1285,7 +1285,7 @@ impl From for u32 { /// /// For more information, see UAX #24: . /// See `UScriptCode` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1538,7 +1538,7 @@ impl_value_getter! { /// /// /// The numeric value is compatible with `UEastAsianWidth` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1631,7 +1631,7 @@ impl_value_getter! { /// value: /// /// The numeric value is compatible with `ULineBreak` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1769,7 +1769,7 @@ impl_value_getter! { /// /// /// The numeric value is compatible with `UGraphemeClusterBreak` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1879,7 +1879,7 @@ impl_value_getter! { /// . /// /// The numeric value is compatible with `UWordBreakValues` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -1996,7 +1996,7 @@ impl_value_getter! { /// . /// /// The numeric value is compatible with `USentenceBreak` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -2103,7 +2103,7 @@ impl_value_getter! { // of this struct. Please do not change the bit layout // or the crate-module-qualified name of this struct // without coordination. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -2251,7 +2251,7 @@ impl_value_getter! { /// . /// /// The numeric value is compatible with `UIndicSyllabicCategory` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))] @@ -2369,7 +2369,7 @@ impl_value_getter! { /// each property value. /// /// The numeric value is compatible with `UJoiningType` in ICU4C. -#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "datagen", derive(databake::Bake))] #[cfg_attr(feature = "datagen", databake(path = icu_properties))]