Add Hash derive to style types (#1002)

This commit is contained in:
gavincrawford 2025-07-22 16:59:18 -06:00 committed by GitHub
parent 8ee044d423
commit fab72d12fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ use std::ops::{BitAnd, BitOr, BitXor};
use crate::style::Attribute; use crate::style::Attribute;
/// a bitset for all possible attributes /// a bitset for all possible attributes
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Attributes(u32); pub struct Attributes(u32);
impl From<Attribute> for Attributes { impl From<Attribute> for Attributes {

View File

@ -5,7 +5,7 @@ use std::fmt::Display;
use crate::style::{Attributes, Color, StyledContent}; use crate::style::{Attributes, Color, StyledContent};
/// The style that can be put on content. /// The style that can be put on content.
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Default, PartialEq, Eq, Hash)]
pub struct ContentStyle { pub struct ContentStyle {
/// The foreground color. /// The foreground color.
pub foreground_color: Option<Color>, pub foreground_color: Option<Color>,

View File

@ -26,7 +26,7 @@ use crate::style::{Color, Colored};
/// ``` /// ```
/// ///
/// See [Color](enum.Color.html). /// See [Color](enum.Color.html).
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Colors { pub struct Colors {
pub foreground: Option<Color>, pub foreground: Option<Color>,
pub background: Option<Color>, pub background: Option<Color>,