Use explicit error::Error impl instead of the default
In a further effort to make the code brain-dead easy to read; use an explicit implementation of `std::error::Error` that returns `None` instead of relying on the default trait implementation.
This commit is contained in:
parent
2512dbafc2
commit
43d3306822
|
@ -329,7 +329,9 @@ impl fmt::Display for TxIndexOutOfRangeError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for TxIndexOutOfRangeError {}
|
impl error::Error for TxIndexOutOfRangeError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
/// A [BlockTransactions] structure is used to provide some of the transactions
|
/// A [BlockTransactions] structure is used to provide some of the transactions
|
||||||
/// in a block, as requested.
|
/// in a block, as requested.
|
||||||
|
|
|
@ -637,7 +637,9 @@ impl fmt::Display for ConversionError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for ConversionError {}
|
impl std::error::Error for ConversionError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
/// Describes the two types of locking, lock-by-blockheight and lock-by-blocktime.
|
/// Describes the two types of locking, lock-by-blockheight and lock-by-blocktime.
|
||||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
|
||||||
|
@ -679,7 +681,9 @@ impl fmt::Display for OperationError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for OperationError {}
|
impl std::error::Error for OperationError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
|
@ -717,7 +717,9 @@ impl fmt::Display for TryFromError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for TryFromError {}
|
impl std::error::Error for TryFromError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
impl Add for U256 {
|
impl Add for U256 {
|
||||||
type Output = Self;
|
type Output = Self;
|
||||||
|
|
|
@ -890,7 +890,9 @@ impl fmt::Display for ExtractTxError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for ExtractTxError {}
|
impl std::error::Error for ExtractTxError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
/// Input index out of bounds (actual index, maximum index allowed).
|
/// Input index out of bounds (actual index, maximum index allowed).
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
@ -931,7 +933,9 @@ impl fmt::Display for IndexOutOfBoundsError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for IndexOutOfBoundsError {}
|
impl std::error::Error for IndexOutOfBoundsError {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None }
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "base64")]
|
#[cfg(feature = "base64")]
|
||||||
mod display_from_str {
|
mod display_from_str {
|
||||||
|
|
Loading…
Reference in New Issue