From 1d277837384e1e8c31e7438da99fc5894a599909 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 9 Aug 2021 16:24:24 +0200 Subject: [PATCH] Consistently use `I::from(Self::get())` in `parameter_types!` (#9526) --- substrate/frame/support/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index a9cbe94d4f..d1a62106dc 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -359,7 +359,6 @@ macro_rules! parameter_types { (IMPL_CONST $name:ident, $type:ty, $value:expr) => { impl $name { /// Returns the value of this parameter type. - #[allow(unused)] pub const fn get() -> $type { $value } @@ -367,14 +366,13 @@ macro_rules! parameter_types { impl> $crate::traits::Get for $name { fn get() -> I { - I::from($value) + I::from(Self::get()) } } }; (IMPL $name:ident, $type:ty, $value:expr) => { impl $name { /// Returns the value of this parameter type. - #[allow(unused)] pub fn get() -> $type { $value } @@ -382,7 +380,7 @@ macro_rules! parameter_types { impl> $crate::traits::Get for $name { fn get() -> I { - I::from($value) + I::from(Self::get()) } } };