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

fix handling of mallformed utf8

This commit is contained in:
Robin Appelman 2020-12-06 21:22:53 +01:00
commit 8f754d3f44
4 changed files with 8 additions and 5 deletions

View file

@ -32,7 +32,7 @@ impl<'a> Demo<'a> {
pub(crate) fn handle_utf8_error(error: BitError) -> ReadResult<String> {
match error {
BitError::Utf8Error(_) => Ok("-- Malformed utf8 --".into()),
BitError::Utf8Error(_, _) => Ok("-- Malformed utf8 --".into()),
_ => Err(error),
}
}

View file

@ -105,7 +105,7 @@ pub enum GameEventError {
impl From<BitError> for ParseError {
fn from(err: BitError) -> ParseError {
match err {
BitError::Utf8Error(utf8_error) => ParseError::MalformedUTF8(utf8_error),
BitError::Utf8Error(utf8_error, _) => ParseError::MalformedUTF8(utf8_error),
_ => ParseError::ReadError(err),
}
}