mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
Fix clippy nonminimal_bool in Ogg continuation check
Current main's clippy (-D warnings) flags the audio branch's '(flags & 1 != 0) != !partial.is_empty()' in media_audio.rs. Rewrite to the suggested '(flags & 1 != 0) == partial.is_empty()', which is boolean-identical (A != !B <=> A == B): error when the continuation flag disagrees with having a partial packet buffered. Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -244,7 +244,7 @@ fn parse_ogg(body: &[u8]) -> Result<(u32, Vec<OggPacket>), String> {
|
||||
expected_sequence = expected_sequence
|
||||
.checked_add(1)
|
||||
.ok_or("Ogg sequence overflow")?;
|
||||
if (flags & 1 != 0) != !partial.is_empty() {
|
||||
if (flags & 1 != 0) == partial.is_empty() {
|
||||
return Err("invalid Ogg packet continuation".into());
|
||||
}
|
||||
if sequence == 0 && flags & 2 == 0 {
|
||||
|
||||
Reference in New Issue
Block a user