clippy: remove unnecessary casts
Rust/va108xx-hal/pipeline/head There was a failure building this commit Details

This commit is contained in:
Robin Müller 2023-01-11 00:41:07 +01:00
parent 6131458a13
commit b776bd2823
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 3 additions and 3 deletions

View File

@ -119,14 +119,14 @@ impl TimingCfg {
} }
pub fn reg(&self) -> u32 { pub fn reg(&self) -> u32 {
((self.tbuf as u32) << 28 (self.tbuf as u32) << 28
| (self.thd_sta as u32) << 24 | (self.thd_sta as u32) << 24
| (self.tsu_sta as u32) << 20 | (self.tsu_sta as u32) << 20
| (self.tsu_sto as u32) << 16 | (self.tsu_sto as u32) << 16
| (self.tlow as u32) << 12 | (self.tlow as u32) << 12
| (self.thigh as u32) << 8 | (self.thigh as u32) << 8
| (self.tf as u32) << 4 | (self.tf as u32) << 4
| (self.tr as u32)) as u32 | (self.tr as u32)
} }
} }

View File

@ -354,7 +354,7 @@ impl<UART: Instance> UartBase<UART> {
}; };
let x = sys_clk.0 as f32 / (config.baudrate.0 * baud_multiplier) as f32; let x = sys_clk.0 as f32 / (config.baudrate.0 * baud_multiplier) as f32;
let integer_part = floorf(x) as u32; let integer_part = floorf(x) as u32;
let frac = floorf((64.0 * (x - integer_part as f32) + 0.5) as f32) as u32; let frac = floorf(64.0 * (x - integer_part as f32) + 0.5) as u32;
self.uart self.uart
.clkscale .clkscale
.write(|w| unsafe { w.bits(integer_part * 64 + frac) }); .write(|w| unsafe { w.bits(integer_part * 64 + frac) });