Skip to content

Commit

Permalink
Remove derives from error types
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
tcharding committed Oct 25, 2023
1 parent ea40b56 commit 45095b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<'a> fmt::UpperHex for DisplayALittleBitHexy<'a> {
}

/// Example Error.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {
/// Conversion error while parsing hex string.
Conversion(HexToBytesError),
Expand Down
4 changes: 2 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl FromHex for Vec<u8> {
}

/// Hex decoding error.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HexToBytesError {
/// Non-hexadecimal character.
InvalidChar(u8),
Expand Down Expand Up @@ -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, Clone, Copy, PartialEq, Eq)]
pub enum HexToArrayError {
/// Conversion error while parsing hex string.
Conversion(HexToBytesError),
Expand Down

0 comments on commit 45095b4

Please sign in to comment.