Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
clippy: remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Jan 10, 2023
1 parent 6131458 commit b776bd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ impl TimingCfg {
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl<UART: Instance> UartBase<UART> {
};
let x = sys_clk.0 as f32 / (config.baudrate.0 * baud_multiplier) as f32;
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
.clkscale
.write(|w| unsafe { w.bits(integer_part * 64 + frac) });
Expand Down

0 comments on commit b776bd2

Please sign in to comment.