Skip to content

Commit

Permalink
impl fmt::Debug for tests regardless of std/no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdplm committed Aug 10, 2018
1 parent f9c7989 commit 84a4ca7
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,7 @@ pub enum FromHexError {
InvalidHexLength,
}

#[cfg(feature = "std")]
impl fmt::Debug for FromHexError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
InvalidHexCharacter(ch, idx) =>
write!(f, "Invalid character '{}' at position {}", ch, idx),
InvalidHexLength => write!(f, "Invalid input length"),
}
}
}

#[cfg(not(feature = "std"))]
#[cfg(any(feature = "std", test))]
impl fmt::Debug for FromHexError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Expand Down

0 comments on commit 84a4ca7

Please sign in to comment.