mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
make parserstate static
This commit is contained in:
parent
25f24b63f6
commit
e5e54de65d
8 changed files with 20 additions and 20 deletions
|
|
@ -82,7 +82,7 @@ impl<'a> MessageIterator<'a> {
|
|||
MessageIterator { packet_data }
|
||||
}
|
||||
|
||||
pub fn next(&mut self, state: &ParserState<'a>) -> Option<Result<Message<'a>>> {
|
||||
pub fn next(&mut self, state: &ParserState) -> Option<Result<Message<'a>>> {
|
||||
while self.packet_data.bits_left() > 6 {
|
||||
let message_type = match MessageType::parse(&mut self.packet_data, state) {
|
||||
Ok(message_type) => message_type,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ pub enum PacketType {
|
|||
}
|
||||
|
||||
impl<'a> Parse<'a> for Packet<'a> {
|
||||
fn parse(stream: &mut Stream<'a>, state: &ParserState<'a>) -> Result<Self> {
|
||||
fn parse(stream: &mut Stream<'a>, state: &ParserState) -> 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