Skip to content

Commit e78733a

Browse files
authored
Parenthesize shift expressions (#106)
1 parent 811fd70 commit e78733a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/charwise/iter.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ where
7979
let (i, rest) = unsafe { self.inner.next().unwrap_unchecked() };
8080
let c = u32::from(rest & 0x3f);
8181
if first < 0xe0 {
82-
(i + 1, u32::from(first & 0x1f) << 6 | c)
82+
(i + 1, (u32::from(first & 0x1f) << 6) | c)
8383
} else {
8484
// 3 bytes ~
8585
let (i, rest) = unsafe { self.inner.next().unwrap_unchecked() };
86-
let c = c << 6 | u32::from(rest & 0x3f);
86+
let c = (c << 6) | u32::from(rest & 0x3f);
8787
if first < 0xf0 {
88-
(i + 1, u32::from(first & 0x0f) << 12 | c)
88+
(i + 1, (u32::from(first & 0x0f) << 12) | c)
8989
} else {
9090
// 4 bytes
9191
let (i, rest) = unsafe { self.inner.next().unwrap_unchecked() };
92-
let c = c << 6 | u32::from(rest & 0x3f);
93-
(i + 1, u32::from(first & 0x07) << 18 | c)
92+
let c = (c << 6) | u32::from(rest & 0x3f);
93+
(i + 1, (u32::from(first & 0x07) << 18) | c)
9494
}
9595
}
9696
};

src/intpack.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ impl U24nU8 {
4343

4444
#[inline(always)]
4545
pub fn set_a(&mut self, a: U24) {
46-
self.0 = a.get() << 8 | u32::from(self.b());
46+
self.0 = (a.get() << 8) | u32::from(self.b());
4747
}
4848

4949
#[inline(always)]
5050
pub fn set_b(&mut self, b: u8) {
51-
self.0 = self.a().get() << 8 | u32::from(b);
51+
self.0 = (self.a().get() << 8) | u32::from(b);
5252
}
5353
}
5454

0 commit comments

Comments
 (0)