From 6bfb3bb6f8765f83190c49f49b2f7037a6507dd4 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 8 Jan 2025 15:30:24 +0100 Subject: [PATCH] chore: rm redundant std cfgs (#13733) --- crates/evm/execution-errors/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/evm/execution-errors/src/lib.rs b/crates/evm/execution-errors/src/lib.rs index f49fa693f..cc723fa11 100644 --- a/crates/evm/execution-errors/src/lib.rs +++ b/crates/evm/execution-errors/src/lib.rs @@ -11,7 +11,10 @@ extern crate alloc; -use alloc::{boxed::Box, string::String}; +use alloc::{ + boxed::Box, + string::{String, ToString}, +}; use alloy_eips::BlockNumHash; use alloy_primitives::B256; use reth_consensus::ConsensusError; @@ -134,7 +137,6 @@ pub enum BlockExecutionError { impl BlockExecutionError { /// Create a new [`BlockExecutionError::Internal`] variant, containing a /// [`InternalBlockExecutionError::Other`] error. - #[cfg(feature = "std")] pub fn other(error: E) -> Self where E: core::error::Error + Send + Sync + 'static, @@ -144,8 +146,7 @@ impl BlockExecutionError { /// Create a new [`BlockExecutionError::Internal`] variant, containing a /// [`InternalBlockExecutionError::Other`] error with the given message. - #[cfg(feature = "std")] - pub fn msg(msg: impl std::fmt::Display) -> Self { + pub fn msg(msg: impl core::fmt::Display) -> Self { Self::Internal(InternalBlockExecutionError::msg(msg)) } @@ -195,7 +196,6 @@ pub enum InternalBlockExecutionError { impl InternalBlockExecutionError { /// Create a new [`InternalBlockExecutionError::Other`] variant. - #[cfg(feature = "std")] pub fn other(error: E) -> Self where E: core::error::Error + Send + Sync + 'static, @@ -204,8 +204,7 @@ impl InternalBlockExecutionError { } /// Create a new [`InternalBlockExecutionError::Other`] from a given message. - #[cfg(feature = "std")] - pub fn msg(msg: impl std::fmt::Display) -> Self { + pub fn msg(msg: impl core::fmt::Display) -> Self { Self::Other(msg.to_string().into()) } }