mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
some error cleanup
This commit is contained in:
parent
68416d6025
commit
8d6ef8e2fb
15 changed files with 311 additions and 189 deletions
|
|
@ -4,7 +4,7 @@ use crate::demo::parser::MalformedSendPropDefinitionError;
|
|||
use crate::demo::sendprop::{
|
||||
SendPropDefinition, SendPropDefinitionIndex, SendPropFlag, SendPropName, SendPropType,
|
||||
};
|
||||
use crate::{MalformedDemoError, Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||
use parse_display::{Display, FromStr};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::borrow::Borrow;
|
||||
|
|
@ -220,7 +220,7 @@ impl Parse for DataTablePacket {
|
|||
let server_classes = packet_data.read_sized(server_class_count)?;
|
||||
|
||||
if packet_data.bits_left() > 7 {
|
||||
Err(MalformedDemoError::DataRemaining(packet_data.bits_left()).into())
|
||||
Err(ParseError::DataRemaining(packet_data.bits_left()))
|
||||
} else {
|
||||
Ok(DataTablePacket {
|
||||
tick,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::fmt;
|
|||
use bitstream_reader::{BitRead, LittleEndian};
|
||||
|
||||
use crate::demo::message::stringtable::StringTableMeta;
|
||||
use crate::{MalformedDemoError, Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||
use crate::{Parse, ParseError, ParserState, ReadResult, Result, Stream};
|
||||
|
||||
#[derive(BitRead, Clone, Copy, Debug)]
|
||||
pub struct FixedUserDataSize {
|
||||
|
|
@ -125,7 +125,7 @@ impl Parse for StringTablePacket {
|
|||
let tables = packet_data.read_sized(count)?;
|
||||
|
||||
if packet_data.bits_left() > 7 {
|
||||
Err(MalformedDemoError::DataRemaining(packet_data.bits_left()).into())
|
||||
Err(ParseError::DataRemaining(packet_data.bits_left()))
|
||||
} else {
|
||||
Ok(StringTablePacket { tick, tables })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue