From 54ed32ed42c2abb00545214a5c69626a0d13cc9d Mon Sep 17 00:00:00 2001 From: thiolliere Date: Fri, 19 Jun 2020 13:41:23 +0200 Subject: [PATCH] llow decl-module to have a where clause with trailing comma --- frame/support/src/dispatch.rs | 3 ++- frame/support/test/tests/system.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frame/support/src/dispatch.rs b/frame/support/src/dispatch.rs index edb6e62639642..d9a3561802c8f 100644 --- a/frame/support/src/dispatch.rs +++ b/frame/support/src/dispatch.rs @@ -283,7 +283,7 @@ macro_rules! decl_module { $trait_instance:ident: $trait_name:ident $( , I: $instantiable:path $( = $module_default_instance:path )? )? > - for enum $call_type:ident where origin: $origin_type:ty $(, $where_ty:ty: $where_bound:path )* { + for enum $call_type:ident where origin: $origin_type:ty $(, $where_ty:ty: $where_bound:path )* $(,)? { $( $t:tt )* } ) => { @@ -317,6 +317,7 @@ macro_rules! decl_module { origin: $origin_type:ty, system = $system:ident $(, $where_ty:ty: $where_bound:path )* + $(,)? { $($t:tt)* } diff --git a/frame/support/test/tests/system.rs b/frame/support/test/tests/system.rs index c3c47d2065130..0d6a22fd1a3e1 100644 --- a/frame/support/test/tests/system.rs +++ b/frame/support/test/tests/system.rs @@ -31,7 +31,7 @@ pub trait Trait: 'static + Eq + Clone { } frame_support::decl_module! { - pub struct Module for enum Call where origin: T::Origin {} + pub struct Module for enum Call where origin: T::Origin, {} } impl Module {