allow trailing commas in declare_state_packets

This commit is contained in:
mat 2022-04-19 20:37:42 -05:00
parent 58e58dfa8f
commit a45eb6deb2

View file

@ -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 })