From fab72d12fe89d3da56e5634b231c93668a8f0210 Mon Sep 17 00:00:00 2001 From: gavincrawford <94875769+gavincrawford@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:59:18 -0600 Subject: [PATCH] Add `Hash` derive to style types (#1002) --- src/style/attributes.rs | 2 +- src/style/content_style.rs | 2 +- src/style/types/colors.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style/attributes.rs b/src/style/attributes.rs index 83dea3ed..c8e7974a 100644 --- a/src/style/attributes.rs +++ b/src/style/attributes.rs @@ -3,7 +3,7 @@ use std::ops::{BitAnd, BitOr, BitXor}; use crate::style::Attribute; /// 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); impl From for Attributes { diff --git a/src/style/content_style.rs b/src/style/content_style.rs index 6e99bb66..16177359 100644 --- a/src/style/content_style.rs +++ b/src/style/content_style.rs @@ -5,7 +5,7 @@ use std::fmt::Display; use crate::style::{Attributes, Color, StyledContent}; /// 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 { /// The foreground color. pub foreground_color: Option, diff --git a/src/style/types/colors.rs b/src/style/types/colors.rs index 0b4afbf0..ea5354c0 100644 --- a/src/style/types/colors.rs +++ b/src/style/types/colors.rs @@ -26,7 +26,7 @@ use crate::style::{Color, Colored}; /// ``` /// /// See [Color](enum.Color.html). -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct Colors { pub foreground: Option, pub background: Option,