Skip to content

Commit

Permalink
Make extra_derives optional by using $()? syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
MxmUrw committed Oct 1, 2024
1 parent 283a3de commit 840a85c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions state-chain/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod chains;

#[macro_export]
macro_rules! define_wrapper_type {
($name: ident, $inner: ty, extra_derives: $( $extra_derive: ident ),* ) => {
($name: ident, $inner: ty $(, extra_derives: $( $extra_derive: ident ),*)? ) => {

#[derive(
Clone,
Expand All @@ -34,7 +34,7 @@ macro_rules! define_wrapper_type {
TypeInfo,
MaxEncodedLen,
Default,
$( $extra_derive ),*
$($( $extra_derive ),*)?
)]
pub struct $name(pub $inner);

Expand Down Expand Up @@ -64,11 +64,6 @@ macro_rules! define_wrapper_type {
}
}
};

($name: ident, $inner: ty) => {
$crate::define_wrapper_type!($name, $inner, extra_derives:)
};

}

pub use chains::{assets::any::Asset, ForeignChain};
Expand Down

0 comments on commit 840a85c

Please sign in to comment.