From cbad0a141e5f9b25e7eec590ca5f90632180ede6 Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Tue, 31 Mar 2020 18:20:22 -0400 Subject: [PATCH] More trait impls --- src/colors.rs | 4 ++-- src/writers/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/colors.rs b/src/colors.rs index 11ad75c..85c8707 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -4,7 +4,7 @@ pub const PALETTE_SIZE: usize = 768; /// Represents a 16 bit color used for vga display. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[repr(u8)] pub enum Color16 { /// Represents the color `Black (0x0)`. @@ -48,7 +48,7 @@ impl From for u8 { } /// Represents a color for vga text modes. -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[repr(transparent)] pub struct TextModeColor(u8); diff --git a/src/writers/mod.rs b/src/writers/mod.rs index c6c6efa..a129de3 100644 --- a/src/writers/mod.rs +++ b/src/writers/mod.rs @@ -20,7 +20,7 @@ pub use text_40x50::Text40x50; pub use text_80x25::Text80x25; /// Represents a `ScreenCharacter` in vga text modes. -#[derive(Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[repr(C)] pub struct ScreenCharacter { character: u8,