diff --git a/crates/varcon-parser/src/lib.rs b/crates/varcon-parser/src/lib.rs index eedf136..76c341d 100644 --- a/crates/varcon-parser/src/lib.rs +++ b/crates/varcon-parser/src/lib.rs @@ -2,7 +2,7 @@ mod parser; pub use parser::ClusterIter; -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Cluster { pub header: Option, pub entries: Vec, @@ -17,7 +17,7 @@ impl Cluster { } } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Entry { pub variants: Vec, pub pos: Option, @@ -66,13 +66,13 @@ fn imply(variants: &mut Vec, required: Category, missing: Category) { } } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Variant { pub types: Vec, pub word: String, } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Type { pub category: Category, pub tag: Option, @@ -89,7 +89,7 @@ pub enum Category { Other, } -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] pub enum Tag { Eq, Variant, diff --git a/crates/varcon/src/lib.rs b/crates/varcon/src/lib.rs index fdff445..bb4be6b 100644 --- a/crates/varcon/src/lib.rs +++ b/crates/varcon/src/lib.rs @@ -2,14 +2,14 @@ mod codegen; pub use codegen::*; -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Cluster { pub header: Option<&'static str>, pub entries: &'static [Entry], pub notes: &'static [&'static str], } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Entry { pub variants: &'static [Variant], pub pos: Option, @@ -19,13 +19,13 @@ pub struct Entry { pub comment: Option<&'static str>, } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Variant { pub types: &'static [Type], pub word: &'static str, } -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Debug)] pub struct Type { pub category: Category, pub tag: Option,