diff --git a/srml/support/src/dispatch.rs b/srml/support/src/dispatch.rs index 301d346df44ac..9f30f6195b0ef 100644 --- a/srml/support/src/dispatch.rs +++ b/srml/support/src/dispatch.rs @@ -487,12 +487,10 @@ macro_rules! decl_module { $(#[doc = $doc_attr:tt])* $vis:vis fn $name:ident ( root $(, $param:ident : $param_ty:ty )* ) { $( $impl:tt )* } ) => { - impl<$trait_instance: $trait_name> $module<$trait_instance> { - $(#[doc = $doc_attr])* - $vis fn $name($( $param: $param_ty ),* ) -> $crate::dispatch::Result { - { $( $impl )* } - Ok(()) - } + $(#[doc = $doc_attr])* + $vis fn $name($( $param: $param_ty ),* ) -> $crate::dispatch::Result { + { $( $impl )* } + Ok(()) } }; @@ -505,11 +503,9 @@ macro_rules! decl_module { root $(, $param:ident : $param_ty:ty )* ) -> $result:ty { $( $impl:tt )* } ) => { - impl<$trait_instance: $trait_name> $module<$trait_instance> { - $(#[doc = $doc_attr])* - $vis fn $name($( $param: $param_ty ),* ) -> $result { - $( $impl )* - } + $(#[doc = $doc_attr])* + $vis fn $name($( $param: $param_ty ),* ) -> $result { + $( $impl )* } }; @@ -522,14 +518,12 @@ macro_rules! decl_module { $origin:ident $(, $param:ident : $param_ty:ty )* ) { $( $impl:tt )* } ) => { - impl<$trait_instance: $trait_name> $module<$trait_instance> { - $(#[doc = $doc_attr])* - $vis fn $name( - $origin: $origin_ty $(, $param: $param_ty )* - ) -> $crate::dispatch::Result { - { $( $impl )* } - Ok(()) - } + $(#[doc = $doc_attr])* + $vis fn $name( + $origin: $origin_ty $(, $param: $param_ty )* + ) -> $crate::dispatch::Result { + { $( $impl )* } + Ok(()) } }; @@ -542,11 +536,9 @@ macro_rules! decl_module { $origin:ident $(, $param:ident : $param_ty:ty )* ) -> $result:ty { $( $impl:tt )* } ) => { - impl<$trait_instance: $trait_name> $module<$trait_instance> { - $(#[doc = $doc_attr])* - $vis fn $name($origin: $origin_ty $(, $param: $param_ty )* ) -> $result { - $( $impl )* - } + $(#[doc = $doc_attr])* + $vis fn $name($origin: $origin_ty $(, $param: $param_ty )* ) -> $result { + $( $impl )* } }; @@ -601,18 +593,23 @@ macro_rules! decl_module { $( $deposit_event )* } - $( - decl_module! { - @impl_function - $mod_type<$trait_instance: $trait_name>; - $origin_type; - $from; - $(#[doc = $doc_attr])* - $fn_vis fn $fn_name ( - $from $(, $param_name : $param )* - ) $( -> $result )* { $( $impl )* } - } - )* + /// Can also be called using [`Call`]. + /// + /// [`Call`]: enum.Call.html + impl<$trait_instance: $trait_name> $mod_type<$trait_instance> { + $( + decl_module! { + @impl_function + $mod_type<$trait_instance: $trait_name>; + $origin_type; + $from; + $(#[doc = $doc_attr])* + $fn_vis fn $fn_name ( + $from $(, $param_name : $param )* + ) $( -> $result )* { $( $impl )* } + } + )* + } #[cfg(feature = "std")] $(#[$attr])* diff --git a/srml/support/src/event.rs b/srml/support/src/event.rs index 50c2947814821..c945360f9c9e4 100644 --- a/srml/support/src/event.rs +++ b/srml/support/src/event.rs @@ -227,6 +227,10 @@ macro_rules! __decl_generic_event { { $( $events:tt )* }; { ,$( $generic_param:ident = $generic_type:ty ),* }; ) => { + /// [`RawEvent`] specialized for the configuration [`Trait`] + /// + /// [`RawEvent`]: enum.RawEvent.html + /// [`Trait`]: trait.Trait.html pub type Event<$event_generic_param> = RawEvent<$( $generic_type ),*>; // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. #[derive(Clone, PartialEq, Eq, $crate::codec::Encode, $crate::codec::Decode)]