chore: rm redundant std cfgs (#13733)

This commit is contained in:
Matthias Seitz
2025-01-08 15:30:24 +01:00
committed by GitHub
parent 8f2ecc44e8
commit 6bfb3bb6f8

View File

@ -11,7 +11,10 @@
extern crate alloc; extern crate alloc;
use alloc::{boxed::Box, string::String}; use alloc::{
boxed::Box,
string::{String, ToString},
};
use alloy_eips::BlockNumHash; use alloy_eips::BlockNumHash;
use alloy_primitives::B256; use alloy_primitives::B256;
use reth_consensus::ConsensusError; use reth_consensus::ConsensusError;
@ -134,7 +137,6 @@ pub enum BlockExecutionError {
impl BlockExecutionError { impl BlockExecutionError {
/// Create a new [`BlockExecutionError::Internal`] variant, containing a /// Create a new [`BlockExecutionError::Internal`] variant, containing a
/// [`InternalBlockExecutionError::Other`] error. /// [`InternalBlockExecutionError::Other`] error.
#[cfg(feature = "std")]
pub fn other<E>(error: E) -> Self pub fn other<E>(error: E) -> Self
where where
E: core::error::Error + Send + Sync + 'static, E: core::error::Error + Send + Sync + 'static,
@ -144,8 +146,7 @@ impl BlockExecutionError {
/// Create a new [`BlockExecutionError::Internal`] variant, containing a /// Create a new [`BlockExecutionError::Internal`] variant, containing a
/// [`InternalBlockExecutionError::Other`] error with the given message. /// [`InternalBlockExecutionError::Other`] error with the given message.
#[cfg(feature = "std")] pub fn msg(msg: impl core::fmt::Display) -> Self {
pub fn msg(msg: impl std::fmt::Display) -> Self {
Self::Internal(InternalBlockExecutionError::msg(msg)) Self::Internal(InternalBlockExecutionError::msg(msg))
} }
@ -195,7 +196,6 @@ pub enum InternalBlockExecutionError {
impl InternalBlockExecutionError { impl InternalBlockExecutionError {
/// Create a new [`InternalBlockExecutionError::Other`] variant. /// Create a new [`InternalBlockExecutionError::Other`] variant.
#[cfg(feature = "std")]
pub fn other<E>(error: E) -> Self pub fn other<E>(error: E) -> Self
where where
E: core::error::Error + Send + Sync + 'static, E: core::error::Error + Send + Sync + 'static,
@ -204,8 +204,7 @@ impl InternalBlockExecutionError {
} }
/// Create a new [`InternalBlockExecutionError::Other`] from a given message. /// Create a new [`InternalBlockExecutionError::Other`] from a given message.
#[cfg(feature = "std")] pub fn msg(msg: impl core::fmt::Display) -> Self {
pub fn msg(msg: impl std::fmt::Display) -> Self {
Self::Other(msg.to_string().into()) Self::Other(msg.to_string().into())
} }
} }