Skip to content

Commit 318f25f

Browse files
committed
clippy
1 parent 52731c9 commit 318f25f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/flash.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'a> FlashWriter<'a> {
112112
}
113113

114114
fn valid_length(&self, offset: u32, length: usize) -> Result<()> {
115-
if offset + length as u32 > self.flash_sz.kbytes() as u32 {
115+
if offset + length as u32 > self.flash_sz.kbytes() {
116116
Err(Error::LengthTooLong)
117117
} else if length & 0x1 != 0 {
118118
Err(Error::LengthNotMultiple2)
@@ -178,7 +178,7 @@ impl<'a> FlashWriter<'a> {
178178
let size = self.sector_sz.kbytes() as u32;
179179
let start = start_offset & !(size - 1);
180180
for idx in (start..start + size).step_by(2) {
181-
let write_address = (FLASH_START + idx as u32) as *const u16;
181+
let write_address = (FLASH_START + idx) as *const u16;
182182
let verify: u16 = unsafe { core::ptr::read_volatile(write_address) };
183183
if verify != 0xFFFF {
184184
return Err(Error::VerifyError);
@@ -209,7 +209,7 @@ impl<'a> FlashWriter<'a> {
209209
pub fn read(&self, offset: u32, length: usize) -> Result<&[u8]> {
210210
self.valid_address(offset)?;
211211

212-
if offset + length as u32 > self.flash_sz.kbytes() as u32 {
212+
if offset + length as u32 > self.flash_sz.kbytes() {
213213
return Err(Error::LengthTooLong);
214214
}
215215

src/gpio.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ pub trait GpioExt {
125125
fn split(self) -> Self::Parts;
126126

127127
/// Splits the GPIO block into independent pins and registers without resetting its state.
128+
///
129+
/// # Safety
130+
/// Make sure that all pins modes are set in reset state.
128131
unsafe fn split_without_reset(self) -> Self::Parts;
129132
}
130133

0 commit comments

Comments
 (0)