Impl new_from for wrapper types

This commit is contained in:
Omar Abdulla
2025-07-17 15:33:28 +03:00
parent 2ef6f7ba63
commit 84ab873b46
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -52,6 +52,10 @@ macro_rules! define_wrapper_type {
Self(value)
}
pub fn new_from<T: Into<$ty>>(value: T) -> Self {
Self(value.into())
}
pub fn into_inner(self) -> $ty {
self.0
}
+2 -2
View File
@@ -191,10 +191,10 @@ impl Metadata {
metadata.file_path = Some(path.to_path_buf());
metadata.contracts = Some(
[(
ContractAlias::new("test".into()),
ContractAlias::new_from("test"),
ContractPathAndIdentifier {
contract_source_path: path.to_path_buf(),
contract_ident: ContractIdent::new("Test".into()),
contract_ident: ContractIdent::new_from("Test"),
},
)]
.into(),