mirror of
https://github.com/sayanarijit/xplr
synced 2024-11-04 18:00:14 +00:00
Derive PartialEq
This commit is contained in:
parent
46287f6373
commit
2ef7523bb0
11
src/ui.rs
11
src/ui.rs
@ -206,7 +206,7 @@ impl Modifier {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
#[derive(Debug, PartialEq, Clone, Default, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Style {
|
||||
pub fg: Option<Color>,
|
||||
@ -215,15 +215,6 @@ pub struct Style {
|
||||
pub sub_modifiers: Option<IndexSet<Modifier>>,
|
||||
}
|
||||
|
||||
impl PartialEq for Style {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.fg == other.fg
|
||||
&& self.bg == other.bg
|
||||
&& self.add_modifiers == other.add_modifiers
|
||||
&& self.sub_modifiers == other.sub_modifiers
|
||||
}
|
||||
}
|
||||
|
||||
impl Style {
|
||||
pub fn extend(mut self, other: &Self) -> Self {
|
||||
self.fg = other.fg.or(self.fg);
|
||||
|
Loading…
Reference in New Issue
Block a user