Allow for auto display impl in declare wrapper type macro

This commit is contained in:
Omar Abdulla
2025-08-18 09:41:25 +03:00
parent 84026f9aee
commit fb3959d345
4 changed files with 30 additions and 13 deletions
+1 -7
View File
@@ -72,11 +72,5 @@ impl Case {
define_wrapper_type!(
/// A wrapper type for the index of test cases found in metadata file.
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CaseIdx(usize);
pub struct CaseIdx(usize) impl Display;
);
impl std::fmt::Display for CaseIdx {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
+2 -2
View File
@@ -188,7 +188,7 @@ define_wrapper_type! {
/// This represents an item in the [`Calldata::Compound`] variant.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[serde(transparent)]
pub struct CalldataItem(String);
pub struct CalldataItem(String) impl Display;
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
@@ -233,7 +233,7 @@ pub enum Method {
define_wrapper_type!(
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EtherValue(U256);
pub struct EtherValue(U256) impl Display;
);
#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)]
+2 -2
View File
@@ -266,7 +266,7 @@ define_wrapper_type!(
Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize,
)]
#[serde(transparent)]
pub struct ContractInstance(String);
pub struct ContractInstance(String) impl Display;
);
define_wrapper_type!(
@@ -277,7 +277,7 @@ define_wrapper_type!(
Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize,
)]
#[serde(transparent)]
pub struct ContractIdent(String);
pub struct ContractIdent(String) impl Display;
);
/// Represents an identifier used for contracts.