diff options
Diffstat (limited to 'src/display/color.rs')
-rw-r--r-- | src/display/color.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/display/color.rs b/src/display/color.rs index b1e799c5ed9f..afe0039998b8 100644 --- a/src/display/color.rs +++ b/src/display/color.rs @@ -15,6 +15,15 @@ impl Color { } } +impl PartialEq for Color { + fn eq(&self, other: &Self) -> bool { + format!("{}{}", color::Fg(self), color::Bg(self)) + == format!("{}{}", color::Fg(other), color::Bg(other)) + } +} + +impl Eq for Color {} + impl color::Color for Color { fn write_fg(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.write_fg(f) |