diff --git a/src/buffer.rs b/src/buffer.rs index b856376..c9cbb04 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -8,7 +8,7 @@ use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; /// A buffer cell -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Cell { pub symbol: String, pub fg: Color, @@ -105,7 +105,7 @@ impl Default for Cell { /// buf.get_mut(5, 0).set_char('x'); /// assert_eq!(buf.get(5, 0).symbol, "x"); /// ``` -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct Buffer { /// The area represented by this buffer pub area: Rect, diff --git a/src/layout.rs b/src/layout.rs index 624c22b..651e174 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -51,7 +51,7 @@ pub struct Margin { pub horizontal: u16, } -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Alignment { Left, Center, diff --git a/src/style.rs b/src/style.rs index 8a260f6..2c834ec 100644 --- a/src/style.rs +++ b/src/style.rs @@ -2,7 +2,7 @@ use bitflags::bitflags; -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Color { Reset, @@ -115,7 +115,7 @@ bitflags! { /// buffer.get(0, 0).style(), /// ); /// ``` -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Style { pub fg: Option, diff --git a/src/text.rs b/src/text.rs index 7d99343..2489597 100644 --- a/src/text.rs +++ b/src/text.rs @@ -52,14 +52,14 @@ use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; /// A grapheme associated to a style. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct StyledGrapheme<'a> { pub symbol: &'a str, pub style: Style, } /// A string where all graphemes have the same style. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Span<'a> { pub content: Cow<'a, str>, pub style: Style, @@ -194,7 +194,7 @@ impl<'a> From<&'a str> for Span<'a> { } /// A string composed of clusters of graphemes, each with their own style. -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Default, Eq)] pub struct Spans<'a>(pub Vec>); impl<'a> Spans<'a> { @@ -273,7 +273,7 @@ impl<'a> From> for String { /// text.extend(Text::styled("Some more lines\nnow with more style!", style)); /// assert_eq!(6, text.height()); /// ``` -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Default, Eq)] pub struct Text<'a> { pub lines: Vec>, } diff --git a/src/widgets/block.rs b/src/widgets/block.rs index ae5b58a..640a80b 100644 --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -7,7 +7,7 @@ use crate::{ widgets::{Borders, Widget}, }; -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum BorderType { Plain, Rounded, @@ -41,7 +41,7 @@ impl BorderType { /// .border_type(BorderType::Rounded) /// .style(Style::default().bg(Color::Black)); /// ``` -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Block<'a> { /// Optional title place on the upper left of the block title: Option>, diff --git a/src/widgets/list.rs b/src/widgets/list.rs index b0279d7..d785d54 100644 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -26,7 +26,7 @@ impl ListState { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct ListItem<'a> { content: Text<'a>, style: Style, diff --git a/src/widgets/table.rs b/src/widgets/table.rs index f696114..e1b1bf6 100644 --- a/src/widgets/table.rs +++ b/src/widgets/table.rs @@ -31,7 +31,7 @@ use unicode_width::UnicodeWidthStr; /// /// You can apply a [`Style`] on the entire [`Cell`] using [`Cell::style`] or rely on the styling /// capabilities of [`Text`]. -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct Cell<'a> { content: Text<'a>, style: Style, @@ -86,7 +86,7 @@ where /// ``` /// /// By default, a row has a height of 1 but you can change this using [`Row::height`]. -#[derive(Debug, Clone, PartialEq, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct Row<'a> { cells: Vec>, height: u16, @@ -186,7 +186,7 @@ impl<'a> Row<'a> { /// // ...and potentially show a symbol in front of the selection. /// .highlight_symbol(">>"); /// ``` -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Table<'a> { /// A block to wrap the widget in block: Option>,