mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 10:27:59 +00:00
Convert another instance of Into impl to From in the macros (#8986)
* Convert another instance of Into impl to From in the macros * Convert another location
This commit is contained in:
@@ -227,13 +227,13 @@ pub fn expand_outer_origin(
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<#scrate::sp_std::result::Result<#system_path::Origin<#runtime>, Origin>> for Origin {
|
||||
impl From<Origin> for #scrate::sp_std::result::Result<#system_path::Origin<#runtime>, Origin> {
|
||||
/// NOTE: converting to pallet origin loses the origin filter information.
|
||||
fn into(self) -> #scrate::sp_std::result::Result<#system_path::Origin<#runtime>, Self> {
|
||||
if let OriginCaller::system(l) = self.caller {
|
||||
fn from(val: Origin) -> Self {
|
||||
if let OriginCaller::system(l) = val.caller {
|
||||
Ok(l)
|
||||
} else {
|
||||
Err(self)
|
||||
Err(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,13 +314,13 @@ fn expand_origin_pallet_conversions(
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<#scrate::sp_std::result::Result<#pallet_origin, Origin>> for Origin {
|
||||
impl From<Origin> for #scrate::sp_std::result::Result<#pallet_origin, Origin> {
|
||||
/// NOTE: converting to pallet origin loses the origin filter information.
|
||||
fn into(self) -> #scrate::sp_std::result::Result<#pallet_origin, Self> {
|
||||
if let OriginCaller::#variant(l) = self.caller {
|
||||
fn from(val: Origin) -> Self {
|
||||
if let OriginCaller::#variant(l) = val.caller {
|
||||
Ok(l)
|
||||
} else {
|
||||
Err(self)
|
||||
Err(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user