Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions uint/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ pub enum FromDecStrErr {
InvalidLength,
}

impl std::fmt::Display for FromDecStrErr {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the CI failure is legit, we should hide this (and the one below) impl under cfg(feature = std)

macro_rules! impl_std_for_uint {

fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
FromDecStrErr::InvalidCharacter => "a character is not in the range 0-9",
FromDecStrErr::InvalidLength => "the number is too large for the type",
}
)
}
}

impl std::error::Error for FromDecStrErr {}

#[macro_export]
#[doc(hidden)]
macro_rules! impl_map_from {
Expand Down