aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-05-21 12:46:02 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-05-21 12:46:02 +0200
commitb65630871a5c14489270d1e6bfe19879f1010587 (patch)
treeb1b4eb4f84f8ab2f935c13fd65459bc076dd9c42 /src/event.rs
parent1e4eaeae1bfd794213f8eee09cb189e7c6fff4d6 (diff)
downloadevtclib-b65630871a5c14489270d1e6bfe19879f1010587.tar.gz
evtclib-b65630871a5c14489270d1e6bfe19879f1010587.tar.bz2
evtclib-b65630871a5c14489270d1e6bfe19879f1010587.zip
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.
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs3
1 files changed, 1 insertions, 2 deletions
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,
))