fix: derive PartialEq for Theme

This commit is contained in:
Ashley Wulber 2023-06-09 17:13:01 -04:00 committed by Ashley Wulber
parent 31d7c75098
commit 6699aa4756
5 changed files with 8 additions and 23 deletions

View file

@ -27,7 +27,7 @@ pub enum Layer {
}
/// Cosmic Theme data structure with all colors and its name
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct Theme<C> {
/// name of the theme
pub name: String,
@ -149,21 +149,6 @@ pub trait LayeredTheme {
fn set_layer(&mut self, layer: Layer);
}
// TODO better eq check
impl<C> PartialEq for Theme<C>
where
C: Clone + fmt::Debug + Default + Into<Srgba> + From<Srgba> + Serialize + DeserializeOwned,
{
fn eq(&self, other: &Self) -> bool {
self.name == other.name
}
}
impl<C> Eq for Theme<C> where
C: Clone + fmt::Debug + Default + Into<Srgba> + From<Srgba> + Serialize + DeserializeOwned
{
}
impl<C> Theme<C> {
/// version of the theme
pub fn version() -> u32 {