mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-14 00:31:05 +00:00
Impl new_from for wrapper types
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user