Remove the unused crate::Error

The `crate::Error` type is now unused, remove it.
This commit is contained in:
Tobin C. Harding 2023-05-24 13:54:24 +10:00
parent 74154c2294
commit 0f74eb6876
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 0 additions and 39 deletions

View File

@ -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<encode::Error> 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 {

View File

@ -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,
};