Skip to content

Commit

Permalink
Remove unused pow::TryFromError type
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharding committed Mar 12, 2024
1 parent 43c5eb7 commit f8de795
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions bitcoin/src/pow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,22 +723,6 @@ impl<T: Into<u128>> From<T> for U256 {
fn from(x: T) -> Self { U256(0, x.into()) }
}

/// Error from `TryFrom<signed type>` implementations, occurs when input is negative.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct TryFromError(i128);

impl fmt::Display for TryFromError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "attempt to create unsigned integer type from negative number: {}", self.0)
}
}

#[cfg(feature = "std")]
impl std::error::Error for TryFromError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
}

impl Add for U256 {
type Output = Self;
fn add(self, rhs: Self) -> Self {
Expand Down

0 comments on commit f8de795

Please sign in to comment.