1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 18:24:05 +02:00

minor cleanup

This commit is contained in:
Robin Appelman 2019-08-12 12:46:26 +02:00
commit a9c76eb27c
3 changed files with 718 additions and 1070 deletions

File diff suppressed because it is too large Load diff

View file

@ -187,7 +187,7 @@ fn parse_string_table_list(
for _ in 0..entry_count { for _ in 0..entry_count {
if !stream.read::<bool>()? { if !stream.read::<bool>()? {
return Err(ParseError::InvalidDemo( return Err(ParseError::InvalidDemo(
"there should be no holes when reading CreateStringTable message".to_string(), "there should be no holes when reading CreateStringTable message",
)); ));
}; };

View file

@ -33,7 +33,7 @@ pub enum ParseError {
/// String table that was send for update doesn't exist /// String table that was send for update doesn't exist
StringTableNotFound(u8), StringTableNotFound(u8),
/// A unknown game event type was read /// A unknown game event type was read
UnknownGameEvent(String), UnknownGameEvent(&'static str),
/// A read game event doesn't contain the expected values /// A read game event doesn't contain the expected values
InvalidGameEvent { InvalidGameEvent {
expected_type: GameEventValueType, expected_type: GameEventValueType,
@ -52,7 +52,7 @@ pub enum ParseError {
size: u32, size: u32,
}, },
/// Misc malformed demo error /// Misc malformed demo error
InvalidDemo(String), InvalidDemo(&'static str),
} }
impl From<ReadError> for ParseError { impl From<ReadError> for ParseError {