1
Fork 0

Fix newtype_index

This commit is contained in:
John Kåre Alsaker 2019-03-09 22:04:00 +01:00
parent 7c19e1eed5
commit 48757a70a3

View file

@ -286,13 +286,15 @@ macro_rules! newtype_index {
); );
// Append comma to end of derives list if it's missing // Append comma to end of derives list if it's missing
(@type [$type:ident] (@attrs [$(#[$attrs:meta])*]
@type [$type:ident]
@max [$max:expr] @max [$max:expr]
@vis [$v:vis] @vis [$v:vis]
@debug_format [$debug_format:tt] @debug_format [$debug_format:tt]
derive [$($derives:ident),*] derive [$($derives:ident),*]
$($tokens:tt)*) => ( $($tokens:tt)*) => (
newtype_index!( newtype_index!(
@attrs [$(#[$attrs])*]
@type [$type] @type [$type]
@max [$max] @max [$max]
@vis [$v] @vis [$v]
@ -303,7 +305,8 @@ macro_rules! newtype_index {
// By not including the @derives marker in this list nor in the default args, we can force it // By not including the @derives marker in this list nor in the default args, we can force it
// to come first if it exists. When encodable is custom, just use the derives list as-is. // to come first if it exists. When encodable is custom, just use the derives list as-is.
(@type [$type:ident] (@attrs [$(#[$attrs:meta])*]
@type [$type:ident]
@max [$max:expr] @max [$max:expr]
@vis [$v:vis] @vis [$v:vis]
@debug_format [$debug_format:tt] @debug_format [$debug_format:tt]
@ -311,6 +314,7 @@ macro_rules! newtype_index {
ENCODABLE = custom ENCODABLE = custom
$($tokens:tt)*) => ( $($tokens:tt)*) => (
newtype_index!( newtype_index!(
@attrs [$(#[$attrs])*]
@derives [$($derives,)+] @derives [$($derives,)+]
@type [$type] @type [$type]
@max [$max] @max [$max]