Skip to content

Commit

Permalink
Address nightly clippy warnings about operator precedence (#3414)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jan 6, 2025
1 parent 20af225 commit 2366bb8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions crates/libs/bindgen/src/winmd/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ impl Blob {
} else {
(
(((self[0] & 0x1F) as usize) << 24)
| (self[1] as usize) << 16
| (self[2] as usize) << 8
| ((self[1] as usize) << 16)
| ((self[2] as usize) << 8)
| self[3] as usize,
4,
)
Expand Down
6 changes: 3 additions & 3 deletions crates/libs/bindgen/src/winmd/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ impl File {

let heap_sizes = result.bytes.copy_as::<u8>(tables_data.0 + 6)?;
let string_index_size = if (heap_sizes & 1) == 1 { 4 } else { 2 };
let guid_index_size = if (heap_sizes >> 1 & 1) == 1 { 4 } else { 2 };
let blob_index_size = if (heap_sizes >> 2 & 1) == 1 { 4 } else { 2 };
let guid_index_size = if ((heap_sizes >> 1) & 1) == 1 { 4 } else { 2 };
let blob_index_size = if ((heap_sizes >> 2) & 1) == 1 { 4 } else { 2 };
let valid_bits = result.bytes.copy_as::<u64>(tables_data.0 + 8)?;
view = tables_data.0 + 24;

Expand Down Expand Up @@ -174,7 +174,7 @@ impl File {
let mut unused_module = Table::default();

for i in 0..64 {
if (valid_bits >> i & 1) == 0 {
if ((valid_bits >> i) & 1) == 0 {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions crates/libs/core/src/guid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ impl GUID {
pub const fn from_u128(uuid: u128) -> Self {
Self {
data1: (uuid >> 96) as u32,
data2: (uuid >> 80 & 0xffff) as u16,
data3: (uuid >> 64 & 0xffff) as u16,
data2: ((uuid >> 80) & 0xffff) as u16,
data3: ((uuid >> 64) & 0xffff) as u16,
data4: (uuid as u64).to_be_bytes(),
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/libs/core/src/imp/sha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ impl ConstBuffer {
.push(b'-')
.push_hex_u16(guid.data3)
.push(b'-')
.push_hex_u16((guid.data4[0] as u16) << 8 | guid.data4[1] as u16)
.push_hex_u16(((guid.data4[0] as u16) << 8) | guid.data4[1] as u16)
.push(b'-')
.push_hex_u16((guid.data4[2] as u16) << 8 | guid.data4[3] as u16)
.push_hex_u16((guid.data4[4] as u16) << 8 | guid.data4[5] as u16)
.push_hex_u16((guid.data4[6] as u16) << 8 | guid.data4[7] as u16)
.push_hex_u16(((guid.data4[2] as u16) << 8) | guid.data4[3] as u16)
.push_hex_u16(((guid.data4[4] as u16) << 8) | guid.data4[5] as u16)
.push_hex_u16(((guid.data4[6] as u16) << 8) | guid.data4[7] as u16)
.push(b'}')
}
}
Expand Down

0 comments on commit 2366bb8

Please sign in to comment.