diff options
| author | mat <github@matdoes.dev> | 2022-04-19 20:37:42 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-19 20:37:42 -0500 |
| commit | a45eb6deb27b8623c3d3ba9b5e21cc638272f5c8 (patch) | |
| tree | d1042cd2324926dcc99d4717f2d78235902445af | |
| parent | 58e58dfa8f6e2cb1a6435016be08ff3de3d8d94a (diff) | |
| download | azalea-drasl-a45eb6deb27b8623c3d3ba9b5e21cc638272f5c8.tar.xz | |
allow trailing commas in declare_state_packets
| -rw-r--r-- | azalea-protocol/packet-macros/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index 3cc3677a..d7f54d84 100644 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -150,13 +150,16 @@ impl Parse for PacketIdMap { input.parse::<Token![::]>()?; // ClientboundChangeDifficultyPacket let name: Ident = input.parse()?; - input.parse::<Token![,]>()?; packets.push(PacketIdPair { id: packet_id, module, name, }); + + if input.parse::<Token![,]>().is_err() { + break; + } } Ok(PacketIdMap { packets }) |
