diff options
Diffstat (limited to 'src/protocol.rs')
-rw-r--r-- | src/protocol.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/protocol.rs b/src/protocol.rs index 0b3e4c1..c9d81c2 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -203,7 +203,7 @@ macro_rules! proto_struct { } }; ($bodyt: ident $(<$($g: ident),*>)? { - $($fname: ident: $ftyp: ty ),+ + $($fname: ident: $ftyp: ty ),+ $(,)? }) => { $crate::as_item! { #[derive(Debug, Clone, PartialEq)] @@ -257,7 +257,7 @@ macro_rules! proto_struct { macro_rules! define_protocol { ($version: literal, $packett: ident, $rawpackett: ident, $rawdt: ident, $kindt: ident => { $($nam: ident, $id: literal, $state: ident, $direction: ident => $body: ident { - $($fnam: ident: $ftyp: ty),* }),* + $($fnam: ident: $ftyp: ty),* $(,)?}),* $(,)? } ) => { $crate::as_item! { @@ -494,7 +494,7 @@ macro_rules! instead_of_ident { #[macro_export] macro_rules! proto_enum_with_type { - ($typ: ty, $typname: ident, $(($bval: literal, $nam: ident $(($bod: ty))?)),*) => { + ($typ: ty, $typname: ident, $(($bval: literal, $nam: ident $(($bod: ty))?)),* $(,)?) => { $crate::as_item! { #[derive(PartialEq, Clone, Debug)] pub enum $typname { @@ -578,28 +578,28 @@ macro_rules! proto_enum_with_type { #[macro_export] macro_rules! proto_byte_enum { - ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),*) => { + ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),* $(,)?) => { proto_enum_with_type!(u8, $typname, $(($bval, $nam $(($bod))?)),*); } } #[macro_export] macro_rules! proto_varint_enum { - ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),*) => { + ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),* $(,)?) => { proto_enum_with_type!(VarInt, $typname, $(($bval, $nam $(($bod))?)),*); } } #[macro_export] macro_rules! proto_int_enum { - ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),*) => { + ($typname: ident, $($bval: literal :: $nam: ident $(($bod: ty))?),* $(,)?) => { proto_enum_with_type!(i32, $typname, $(($bval, $nam $(($bod))?)),*); } } #[macro_export] macro_rules! proto_str_enum { - ($typname: ident, $($sval: literal :: $nam: ident $(($bod: ident))?),*) => { + ($typname: ident, $($sval: literal :: $nam: ident $(($bod: ident))?),* $(,)?) => { crate::as_item! { #[derive(PartialEq, Clone, Debug)] pub enum $typname { @@ -689,7 +689,7 @@ macro_rules! proto_str_enum { #[macro_export] macro_rules! proto_byte_flag { - ($typname: ident, $($bval: literal :: $isnam: ident $setnam: ident),*) => { + ($typname: ident, $($bval: literal :: $isnam: ident $setnam: ident),* $(,)?) => { #[derive(Clone, Copy, PartialEq, Eq, Debug, Default)] pub struct $typname(pub u8); |