Skip to content

Commit

Permalink
chore: Apply fixes for beta clippy::precedence lint
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Jan 9, 2025
1 parent bd44f2d commit 8d84d8b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/src/bitmap/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ pub fn copy_channel<'gc>(

let result_color: u32 = match dest_channel {
// red
1 => (original_color & 0xFF00FFFF) | source_part << 16,
1 => (original_color & 0xFF00FFFF) | (source_part << 16),
// green
2 => (original_color & 0xFFFF00FF) | source_part << 8,
2 => (original_color & 0xFFFF00FF) | (source_part << 8),
// blue
4 => (original_color & 0xFFFFFF00) | source_part,
// alpha
8 => (original_color & 0x00FFFFFF) | source_part << 24,
8 => (original_color & 0x00FFFFFF) | (source_part << 24),
_ => original_color,
};

Expand Down
2 changes: 1 addition & 1 deletion flv/src/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'a> Tag<'a> {
let timestamp_extended = reader.read_u8()?;
let stream_id = reader.read_u24()?;

let timestamp = ((timestamp_extended as u32) << 24 | timestamp) as i32;
let timestamp = (((timestamp_extended as u32) << 24) | timestamp) as i32;
let data_position = reader.stream_position()?;
let new_position = data_position + data_size as u64;

Expand Down
2 changes: 1 addition & 1 deletion render/src/pixel_bender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ fn read_src_reg(val: u32, size: u8) -> Result<PixelBenderReg, Box<dyn std::error
let swizzle = val >> 16;
let mut channels = Vec::new();
for i in 0..size {
channels.push(CHANNELS[(swizzle >> (6 - i * 2) & 3) as usize])
channels.push(CHANNELS[((swizzle >> (6 - i * 2)) & 3) as usize])
}

let kind = if val & 0x8000 != 0 {
Expand Down
2 changes: 1 addition & 1 deletion swf/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ impl<W: Write> Writer<W> {
}

fn write_sound_info(&mut self, sound_info: &SoundInfo) -> Result<()> {
let flags = (sound_info.event as u8) << 4
let flags = ((sound_info.event as u8) << 4)
| if sound_info.in_sample.is_some() {
0b1
} else {
Expand Down
2 changes: 1 addition & 1 deletion video/software/src/decoder/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<'a> ByteReader<'a> {
fn read_u16be(&mut self) -> Result<u16, ScreenError> {
let byte1 = self.read_byte()?;
let byte2 = self.read_byte()?;
Ok((byte1 as u16) << 8 | (byte2 as u16))
Ok(((byte1 as u16) << 8) | (byte2 as u16))
}

fn read_buf_ref(&mut self, length: usize) -> Result<&[u8], ScreenError> {
Expand Down

0 comments on commit 8d84d8b

Please sign in to comment.