From b65630871a5c14489270d1e6bfe19879f1010587 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 21 May 2020 12:46:02 +0200 Subject: ignore unknown statechanges in parse_events The reason why we "unwrap" the error so late is because we want to recover from this error, which means the file pointer has to be at the right position. Unwrapping early would leave the pointer in the middle of an event, which is not what we want. If we want to bullet-proof this, it might be good to read the whole event first into a buffer, and then read from that buffer instead. --- src/event.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/event.rs') diff --git a/src/event.rs b/src/event.rs index a598d3d..971a1a3 100644 --- a/src/event.rs +++ b/src/event.rs @@ -378,8 +378,7 @@ impl TryFrom<&raw::CbtEvent> for Event { | CbtStateChange::SkillInfo | CbtStateChange::SkillTiming | CbtStateChange::BreakbarState - | CbtStateChange::BreakbarPercent - | CbtStateChange::Unknown => { + | CbtStateChange::BreakbarPercent => { return Err(FromRawEventError::UnknownStateChange( raw_event.is_statechange, )) -- cgit v1.2.3