From ee13ff29477dafecdf6f2073c87c71eff9125289 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Wed, 26 May 2021 10:16:53 +0300 Subject: [PATCH] Convert Into to From to make clippy happy (#8900) --- substrate/frame/support/src/origin.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/frame/support/src/origin.rs b/substrate/frame/support/src/origin.rs index 6dd38eb1b2..869296b52f 100644 --- a/substrate/frame/support/src/origin.rs +++ b/substrate/frame/support/src/origin.rs @@ -349,13 +349,13 @@ macro_rules! impl_outer_origin { } } - impl Into<$crate::sp_std::result::Result<$system::Origin<$runtime>, $name>> for $name { + impl From<$name> for $crate::sp_std::result::Result<$system::Origin<$runtime>, $name>{ /// NOTE: converting to pallet origin loses the origin filter information. - fn into(self) -> $crate::sp_std::result::Result<$system::Origin<$runtime>, Self> { - if let $caller_name::system(l) = self.caller { + fn from(val: $name) -> Self { + if let $caller_name::system(l) = val.caller { Ok(l) } else { - Err(self) + Err(val) } } }