11
11
12
12
extern crate alloc;
13
13
14
- use alloc:: { boxed:: Box , string:: String } ;
14
+ use alloc:: {
15
+ boxed:: Box ,
16
+ string:: { String , ToString } ,
17
+ } ;
15
18
use alloy_eips:: BlockNumHash ;
16
19
use alloy_primitives:: B256 ;
17
20
use reth_consensus:: ConsensusError ;
@@ -134,7 +137,6 @@ pub enum BlockExecutionError {
134
137
impl BlockExecutionError {
135
138
/// Create a new [`BlockExecutionError::Internal`] variant, containing a
136
139
/// [`InternalBlockExecutionError::Other`] error.
137
- #[ cfg( feature = "std" ) ]
138
140
pub fn other < E > ( error : E ) -> Self
139
141
where
140
142
E : core:: error:: Error + Send + Sync + ' static ,
@@ -144,8 +146,7 @@ impl BlockExecutionError {
144
146
145
147
/// Create a new [`BlockExecutionError::Internal`] variant, containing a
146
148
/// [`InternalBlockExecutionError::Other`] error with the given message.
147
- #[ cfg( feature = "std" ) ]
148
- pub fn msg ( msg : impl std:: fmt:: Display ) -> Self {
149
+ pub fn msg ( msg : impl core:: fmt:: Display ) -> Self {
149
150
Self :: Internal ( InternalBlockExecutionError :: msg ( msg) )
150
151
}
151
152
@@ -195,7 +196,6 @@ pub enum InternalBlockExecutionError {
195
196
196
197
impl InternalBlockExecutionError {
197
198
/// Create a new [`InternalBlockExecutionError::Other`] variant.
198
- #[ cfg( feature = "std" ) ]
199
199
pub fn other < E > ( error : E ) -> Self
200
200
where
201
201
E : core:: error:: Error + Send + Sync + ' static ,
@@ -204,8 +204,7 @@ impl InternalBlockExecutionError {
204
204
}
205
205
206
206
/// Create a new [`InternalBlockExecutionError::Other`] from a given message.
207
- #[ cfg( feature = "std" ) ]
208
- pub fn msg ( msg : impl std:: fmt:: Display ) -> Self {
207
+ pub fn msg ( msg : impl core:: fmt:: Display ) -> Self {
209
208
Self :: Other ( msg. to_string ( ) . into ( ) )
210
209
}
211
210
}
0 commit comments