diff options
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cell.rs b/src/cell.rs index 61a3cd3..b9d7168 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -11,15 +11,22 @@ pub struct Cell { attrs: crate::attrs::Attrs, } +#[allow(clippy::collapsible_if)] impl PartialEq<Cell> for Cell { fn eq(&self, other: &Self) -> bool { - if self.attrs != other.attrs { - return false; - } if self.len != other.len { return false; } let len = self.len as usize; + if len > 0 { + if self.attrs != other.attrs { + return false; + } + } else { + if self.attrs.bgcolor != other.attrs.bgcolor { + return false; + } + } self.contents[..len] == other.contents[..len] } } |