Skip to content

Commit

Permalink
make Display impl works in no_std env
Browse files Browse the repository at this point in the history
  • Loading branch information
koushiro committed May 20, 2024
1 parent c82a233 commit 1abac11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interpreter/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::Opcode;
use alloc::borrow::Cow;
use core::fmt;

/// Capture represents the result of execution.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -56,9 +57,8 @@ impl From<ExitError> for ExitResult {
#[cfg(feature = "std")]
impl std::error::Error for ExitError {}

#[cfg(feature = "std")]
impl std::fmt::Display for ExitError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl fmt::Display for ExitError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Exception(_) => f.write_str("EVM exit exception"),
Self::Reverted => f.write_str("EVM internal revert"),
Expand Down

0 comments on commit 1abac11

Please sign in to comment.