diff options
| author | mat <github@matdoes.dev> | 2022-04-19 20:37:42 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-19 21:24:53 -0500 |
| commit | 5306d99e33b0247f7deb28da6c68fccc3c49c2ba (patch) | |
| tree | 48f024aefc032c25a6f54a99e01628368aa35e02 /azalea-protocol | |
| parent | 5fd87615cf1514c7f9a0358988964768ded3f06e (diff) | |
| download | azalea-drasl-5306d99e33b0247f7deb28da6c68fccc3c49c2ba.tar.xz | |
allow trailing commas in declare_state_packets
Diffstat (limited to 'azalea-protocol')
| -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 }) |
