Remove the unused crate::Error
The `crate::Error` type is now unused, remove it.
This commit is contained in:
parent
74154c2294
commit
0f74eb6876
|
@ -2,46 +2,8 @@
|
||||||
|
|
||||||
//! Contains error types and other error handling tools.
|
//! Contains error types and other error handling tools.
|
||||||
|
|
||||||
use core::fmt;
|
|
||||||
|
|
||||||
use internals::write_err;
|
|
||||||
|
|
||||||
use crate::consensus::encode;
|
|
||||||
pub use crate::parse::ParseIntError;
|
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
|
/// Impls std::error::Error for the specified type with appropriate attributes, possibly returning
|
||||||
/// source.
|
/// source.
|
||||||
macro_rules! impl_std_error {
|
macro_rules! impl_std_error {
|
||||||
|
|
|
@ -134,7 +134,6 @@ pub use crate::blockdata::{constants, opcodes};
|
||||||
pub use crate::consensus::encode::VarInt;
|
pub use crate::consensus::encode::VarInt;
|
||||||
pub use crate::crypto::key::{self, PrivateKey, PublicKey};
|
pub use crate::crypto::key::{self, PrivateKey, PublicKey};
|
||||||
pub use crate::crypto::{ecdsa, sighash};
|
pub use crate::crypto::{ecdsa, sighash};
|
||||||
pub use crate::error::Error;
|
|
||||||
pub use crate::hash_types::{
|
pub use crate::hash_types::{
|
||||||
BlockHash, PubkeyHash, ScriptHash, Txid, WPubkeyHash, WScriptHash, Wtxid,
|
BlockHash, PubkeyHash, ScriptHash, Txid, WPubkeyHash, WScriptHash, Wtxid,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue