diff --git a/src/localization.rs b/src/localization.rs index ab0d136..3211e8e 100644 --- a/src/localization.rs +++ b/src/localization.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use std::fmt; use std::fs; use std::fs::OpenOptions; +use std::hash::Hash; use std::io::Write; use std::path::PathBuf; @@ -310,7 +311,7 @@ mod by_id { // FIXME: always serialized to Other (which is fine but makes all other options redundant and may be an issue // in the future as only the vanilla languages have a name which is nicer for printing). /// Languages that can be used for translation. -#[derive(Clone, Debug, Default, Eq, Hash, Deserialize)] +#[derive(Clone, Debug, Default, Eq, Deserialize)] #[non_exhaustive] #[serde(untagged)] #[cfg_attr( @@ -574,6 +575,12 @@ impl Language { } } +impl Hash for Language { + fn hash(&self, state: &mut H) { + self.file_id().hash(state); + } +} + impl PartialEq for Language { fn eq(&self, other: &Self) -> bool { self.file_id() == other.file_id()