diff --git a/crates/eips/src/eip1898.rs b/crates/eips/src/eip1898.rs index 67d675c94285..3cacd0904b0f 100644 --- a/crates/eips/src/eip1898.rs +++ b/crates/eips/src/eip1898.rs @@ -212,9 +212,8 @@ pub enum ParseBlockNumberError { } /// Error variants when parsing a [BlockNumberOrTag] -#[cfg(feature = "std")] -impl std::error::Error for ParseBlockNumberError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for ParseBlockNumberError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::ParseIntErr(err) => std::error::Error::source(err), Self::ParseErr(err) => std::error::Error::source(err), @@ -262,8 +261,7 @@ impl Display for HexStringMissingPrefixError { } } -#[cfg(feature = "std")] -impl std::error::Error for HexStringMissingPrefixError {} +impl core::error::Error for HexStringMissingPrefixError {} /// A Block Identifier. /// @@ -566,9 +564,8 @@ impl Display for ParseBlockIdError { } } -#[cfg(feature = "std")] -impl std::error::Error for ParseBlockIdError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for ParseBlockIdError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::ParseIntError(err) => std::error::Error::source(err), Self::FromHexError(err) => std::error::Error::source(err), @@ -784,8 +781,7 @@ impl fmt::Display for ParseBlockHashOrNumberError { } } -#[cfg(feature = "std")] -impl std::error::Error for ParseBlockHashOrNumberError {} +impl core::error::Error for ParseBlockHashOrNumberError {} impl FromStr for HashOrNumber { type Err = ParseBlockHashOrNumberError; diff --git a/crates/eips/src/eip2718.rs b/crates/eips/src/eip2718.rs index 82c11a1f7592..d8888c6860fa 100644 --- a/crates/eips/src/eip2718.rs +++ b/crates/eips/src/eip2718.rs @@ -52,9 +52,8 @@ impl From for alloy_rlp::Error { } } -#[cfg(feature = "std")] -impl std::error::Error for Eip2718Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for Eip2718Error { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::RlpError(err) => Some(err), Self::UnexpectedType(_) => None, diff --git a/crates/eips/src/eip4844/sidecar.rs b/crates/eips/src/eip4844/sidecar.rs index d39b9535dc66..474ac5375c9a 100644 --- a/crates/eips/src/eip4844/sidecar.rs +++ b/crates/eips/src/eip4844/sidecar.rs @@ -411,9 +411,9 @@ pub enum BlobTransactionValidationError { }, } -#[cfg(all(feature = "kzg", feature = "std"))] -impl std::error::Error for BlobTransactionValidationError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +#[cfg(all(feature = "kzg"))] +impl core::error::Error for BlobTransactionValidationError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::KZGError(source) => Some(source), Self::InvalidProof { .. } diff --git a/crates/eips/src/eip4844/trusted_setup_points.rs b/crates/eips/src/eip4844/trusted_setup_points.rs index d3795e890747..50b5e9165805 100644 --- a/crates/eips/src/eip4844/trusted_setup_points.rs +++ b/crates/eips/src/eip4844/trusted_setup_points.rs @@ -131,5 +131,4 @@ impl fmt::Display for KzgErrors { } } -#[cfg(feature = "std")] -impl std::error::Error for KzgErrors {} +impl core::error::Error for KzgErrors {} diff --git a/crates/rpc-types-engine/src/error.rs b/crates/rpc-types-engine/src/error.rs index 9867e3a23c13..4bc853baf816 100644 --- a/crates/rpc-types-engine/src/error.rs +++ b/crates/rpc-types-engine/src/error.rs @@ -69,9 +69,8 @@ pub enum PayloadError { Decode(alloy_rlp::Error), } -#[cfg(feature = "std")] -impl std::error::Error for PayloadError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for PayloadError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::Decode(err) => Some(err), _ => None, @@ -120,5 +119,4 @@ pub enum PayloadValidationError { }, } -#[cfg(feature = "std")] -impl std::error::Error for PayloadValidationError {} +impl core::error::Error for PayloadValidationError {} diff --git a/crates/rpc-types-engine/src/forkchoice.rs b/crates/rpc-types-engine/src/forkchoice.rs index 142d31b1c659..6c13d2856bac 100644 --- a/crates/rpc-types-engine/src/forkchoice.rs +++ b/crates/rpc-types-engine/src/forkchoice.rs @@ -85,8 +85,7 @@ pub enum ForkchoiceUpdateError { UnknownFinalBlock, } -#[cfg(feature = "std")] -impl std::error::Error for ForkchoiceUpdateError {} +impl core::error::Error for ForkchoiceUpdateError {} #[cfg(feature = "jsonrpsee-types")] impl From for jsonrpsee_types::error::ErrorObject<'static> { diff --git a/crates/rpc-types-engine/src/jwt.rs b/crates/rpc-types-engine/src/jwt.rs index 6cdb89f4a84b..bec9869c8db9 100644 --- a/crates/rpc-types-engine/src/jwt.rs +++ b/crates/rpc-types-engine/src/jwt.rs @@ -84,9 +84,8 @@ impl From for JwtError { } } -#[cfg(feature = "std")] -impl std::error::Error for JwtError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for JwtError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::JwtSecretHexDecodeError(err) => Some(err), Self::CreateDir { source, .. } diff --git a/crates/rpc-types-eth/src/block.rs b/crates/rpc-types-eth/src/block.rs index a75cf4cb551b..cee318b150a6 100644 --- a/crates/rpc-types-eth/src/block.rs +++ b/crates/rpc-types-eth/src/block.rs @@ -283,9 +283,8 @@ pub enum BlockError { RlpDecodeRawBlock(alloy_rlp::Error), } -#[cfg(feature = "std")] -impl std::error::Error for BlockError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for BlockError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::RlpDecodeRawBlock(err) => Some(err), _ => None, diff --git a/crates/rpc-types-eth/src/filter.rs b/crates/rpc-types-eth/src/filter.rs index 659e6a7cd10b..ab203fb9791f 100644 --- a/crates/rpc-types-eth/src/filter.rs +++ b/crates/rpc-types-eth/src/filter.rs @@ -165,8 +165,7 @@ pub enum FilterBlockError { }, } -#[cfg(feature = "std")] -impl std::error::Error for FilterBlockError {} +impl core::error::Error for FilterBlockError {} /// Represents the target range of blocks for the filter #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] diff --git a/crates/rpc-types-eth/src/transaction/error.rs b/crates/rpc-types-eth/src/transaction/error.rs index eb4753f5fb31..ab3bfa317c05 100644 --- a/crates/rpc-types-eth/src/transaction/error.rs +++ b/crates/rpc-types-eth/src/transaction/error.rs @@ -74,9 +74,8 @@ pub enum ConversionError { Custom(String), } -#[cfg(feature = "std")] -impl std::error::Error for ConversionError { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { +impl core::error::Error for ConversionError { + fn source(&self) -> Option<&(dyn core::error::Error + 'static)> { match self { Self::Eip2718Error(err) => Some(err), Self::SignatureError(err) => Some(err),