1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-10-01 08:44:05 +02:00

remove the need to allocate all messages in a packet

This commit is contained in:
Robin Appelman 2020-12-06 19:29:11 +01:00
commit 25f24b63f6
7 changed files with 65 additions and 32 deletions

View file

@ -46,7 +46,7 @@ pub enum PacketType {
}
impl<'a> Parse<'a> for Packet<'a> {
fn parse(stream: &mut Stream<'a>, state: &ParserState) -> Result<Self> {
fn parse(stream: &mut Stream<'a>, state: &ParserState<'a>) -> Result<Self> {
let packet_type = PacketType::read(stream)?;
Ok(match packet_type {
PacketType::Sigon => Packet::Sigon(MessagePacket::parse(stream, state)?),