Skip to content

Commit 165e52e

Browse files
authored
treewide: remove unnecessary casts
1 parent 4df1c54 commit 165e52e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hal/src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<const BASE: usize, const N: u8> Pin<BASE, N> {
167167
self.set_mode(cs, sealed::Mode::Alternate);
168168
let mut val: u32 = unsafe { Self::AF_R.read_volatile() };
169169
val &= !(0b1111 << Self::AF_SHIFT);
170-
val |= (af as u8 as u32) << Self::AF_SHIFT;
170+
val |= (af as u32) << Self::AF_SHIFT;
171171
unsafe { Self::AF_W.write_volatile(val) };
172172
}
173173
}

hal/src/subghz/timeout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl Timeout {
147147
let nanos: u128 = duration.as_nanos();
148148
const UPPER_LIMIT: u128 =
149149
Timeout::MAX.as_nanos() as u128 + (Timeout::RESOLUTION_NANOS as u128) / 2;
150-
const LOWER_LIMIT: u128 = (((Timeout::RESOLUTION_NANOS as u128) + 1) / 2) as u128;
150+
const LOWER_LIMIT: u128 = ((Timeout::RESOLUTION_NANOS as u128) + 1) / 2;
151151

152152
if nanos > UPPER_LIMIT {
153153
Err(ValueError::too_high(nanos, UPPER_LIMIT))

0 commit comments

Comments
 (0)