Skip to content

Commit

Permalink
fix(lib): sound mode packet should be all_consuming
Browse files Browse the repository at this point in the history
We want an error if there is extra data in there so we know if additions
are necessary.
  • Loading branch information
Oppzippy committed Aug 13, 2023
1 parent 9a9da71 commit 3898947
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/packets/inbound/sound_mode_update_packet.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use nom::{
combinator::map,
combinator::{all_consuming, map},
error::{context, ContextError, ParseError},
};

Expand All @@ -25,12 +25,12 @@ pub fn take_ambient_sound_mode_update_packet<
// offset 9
context(
"SoundModeUpdatePacket",
map(take_sound_modes, |sound_modes| SoundModeUpdatePacket {
all_consuming(map(take_sound_modes, |sound_modes| SoundModeUpdatePacket {
ambient_sound_mode: sound_modes.ambient_sound_mode,
noise_canceling_mode: sound_modes.noise_canceling_mode,
transparency_mode: sound_modes.transparency_mode,
custom_noise_canceling: sound_modes.custom_noise_canceling,
}),
})),
)(input)
// offset 13
}
Expand Down

0 comments on commit 3898947

Please sign in to comment.