From 0f74eb68762865b7612dfc6656701b753deccf77 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 24 May 2023 13:54:24 +1000 Subject: [PATCH] Remove the unused crate::Error The `crate::Error` type is now unused, remove it. --- bitcoin/src/error.rs | 38 -------------------------------------- bitcoin/src/lib.rs | 1 - 2 files changed, 39 deletions(-) diff --git a/bitcoin/src/error.rs b/bitcoin/src/error.rs index 08570de5..0536c72f 100644 --- a/bitcoin/src/error.rs +++ b/bitcoin/src/error.rs @@ -2,46 +2,8 @@ //! Contains error types and other error handling tools. -use core::fmt; - -use internals::write_err; - -use crate::consensus::encode; pub use crate::parse::ParseIntError; -/// A general error code, other errors should implement conversions to/from this -/// if appropriate. -#[derive(Debug)] -#[non_exhaustive] -pub enum Error { - /// Encoding error - Encode(encode::Error), -} - -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - Error::Encode(ref e) => write_err!(f, "encoding error"; e), - } - } -} - -#[cfg(feature = "std")] -impl std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - use self::Error::*; - - match self { - Encode(e) => Some(e), - } - } -} - -#[doc(hidden)] -impl From for Error { - fn from(e: encode::Error) -> Error { Error::Encode(e) } -} - /// Impls std::error::Error for the specified type with appropriate attributes, possibly returning /// source. macro_rules! impl_std_error { diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index c8cec516..b12b11bb 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -134,7 +134,6 @@ pub use crate::blockdata::{constants, opcodes}; pub use crate::consensus::encode::VarInt; pub use crate::crypto::key::{self, PrivateKey, PublicKey}; pub use crate::crypto::{ecdsa, sighash}; -pub use crate::error::Error; pub use crate::hash_types::{ BlockHash, PubkeyHash, ScriptHash, Txid, WPubkeyHash, WScriptHash, Wtxid, };