use unicode_width::UnicodeWidthStr;
use unicode_width::UnicodeWidthChar;
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ColouredString {
text: String,
colour: String,
}
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ColouredStringSlice<'a> {
text: &'a str,
colour: &'a str,
pub fn text(&self) -> &'a str { &self.text }
}
-impl PartialEq for ColouredString {
- fn eq(&self, rhs: &Self) -> bool {
- self.text == rhs.text && self.colour == rhs.colour
- }
-}
-
-impl Eq for ColouredString {}
-
-impl<'a> PartialEq for ColouredStringSlice<'a> {
- fn eq(&self, rhs: &ColouredStringSlice) -> bool {
- self.text == rhs.text && self.colour == rhs.colour
- }
-}
-
-impl<'a> Eq for ColouredStringSlice<'a> {}
-
impl std::ops::Add<ColouredString> for ColouredString {
type Output = Self;
fn add(self, rhs: Self) -> Self {