From e3184aed0173d4f8eb7be3d0d3d29a9d2c45cd68 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Mon, 3 Jan 2022 13:41:54 +0300 Subject: [PATCH] Derive PartialOrd/Ord for Channels and ColorSpace --- src/types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types.rs b/src/types.rs index 65a5cd1..48419d1 100644 --- a/src/types.rs +++ b/src/types.rs @@ -7,7 +7,7 @@ use crate::utils::unlikely; /// /// Note: the color space is purely informative. Although it is saved to the /// file header, it does not affect encoding/decoding in any way. -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)] #[repr(u8)] pub enum ColorSpace { /// sRGB with linear alpha @@ -56,7 +56,7 @@ impl TryFrom for ColorSpace { } } -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)] #[repr(u8)] pub enum Channels { /// Three 8-bit channels (RGB)