oxilean_codegen/evm_backend/evminstruction_traits.rs
1//! # EvmInstruction - Trait Implementations
2//!
3//! This module contains trait implementations for `EvmInstruction`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::EvmInstruction;
12use std::fmt;
13
14impl fmt::Display for EvmInstruction {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16 write!(f, "{}", self.opcode.mnemonic())?;
17 if let Some(ref data) = self.data {
18 write!(f, " 0x")?;
19 for b in data {
20 write!(f, "{:02x}", b)?;
21 }
22 }
23 if let Some(ref c) = self.comment {
24 write!(f, " ; {}", c)?;
25 }
26 Ok(())
27 }
28}