From e59c211ca719a8f27de2fc98ac2e2bba891ce437 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 25 Oct 2023 14:25:33 +1100 Subject: [PATCH] Remove derives from error types We are slowly settling on a few standards for error types, one of which is a standard set of derives. The errors in this crate are non-exhaustive so we should use: `Debug, Copy, Clone, PartialEq, Eq`. --- examples/custom.rs | 2 +- src/parse.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/custom.rs b/examples/custom.rs index 9eb1a4a..19952a4 100644 --- a/examples/custom.rs +++ b/examples/custom.rs @@ -117,7 +117,7 @@ impl<'a> fmt::UpperHex for DisplayALittleBitHexy<'a> { } /// Example Error. -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum Error { /// Conversion error while parsing hex string. Conversion(HexToBytesError), diff --git a/src/parse.rs b/src/parse.rs index 885d0da..8736379 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -38,7 +38,7 @@ impl FromHex for Vec { } /// Hex decoding error. -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum HexToBytesError { /// Non-hexadecimal character. InvalidChar(u8), @@ -114,7 +114,7 @@ impl_fromhex_array!(384); impl_fromhex_array!(512); /// Hex decoding error. -#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum HexToArrayError { /// Conversion error while parsing hex string. Conversion(HexToBytesError),