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:
parent
28ad5fafde
commit
25f24b63f6
7 changed files with 65 additions and 32 deletions
|
|
@ -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)?),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue