Skip to content

Commit 466dfa1

Browse files
rilliankinetiknz
authored andcommitted
boxes: clarify order of operations.
This code is correct because * has higher precedence than >> which has higher precedence than &, but I had to look that up. Group the multiplication to make this more clear. Corrects a clippy warning.
1 parent b78dc3e commit 466dfa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mp4parse/src/boxes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl From<u32> for FourCC {
4949
fn from(number: u32) -> FourCC {
5050
let mut box_chars = Vec::new();
5151
for x in 0..4 {
52-
let c = (number >> x * 8 & 0x000000FF) as u8;
52+
let c = (number >> (x * 8) & 0x000000FF) as u8;
5353
box_chars.push(c);
5454
}
5555
box_chars.reverse();

0 commit comments

Comments
 (0)