Skip to content

Commit

Permalink
Fix rustc and clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Tosainu committed Dec 3, 2024
1 parent fcddc7b commit 281e629
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion rp2040-combined/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ static ALLOCATOR: Heap = Heap::empty();
)]
mod app {
use crate::bsp;
use crate::ALLOCATOR;

use core::fmt::Write;
use core::mem::MaybeUninit;
use core::ptr::addr_of_mut;

use bsp::{hal, XOSC_CRYSTAL_FREQ};
use hal::{
Expand Down Expand Up @@ -156,7 +158,7 @@ mod app {
{
const HEAP_SIZE: usize = 8 * 1024;
static mut HEAP: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
unsafe { crate::ALLOCATOR.init(HEAP.as_ptr() as usize, HEAP_SIZE) }
unsafe { ALLOCATOR.init(addr_of_mut!(HEAP) as usize, HEAP_SIZE) }
}

let mut resets = ctx.device.RESETS;
Expand Down
3 changes: 2 additions & 1 deletion rp2040-log-to-cdc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ fn configure_pins(
fn main() -> ! {
{
use core::mem::MaybeUninit;
use core::ptr::addr_of_mut;
const HEAP_SIZE: usize = 8 * 1024;
static mut HEAP: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
unsafe { ALLOCATOR.init(HEAP.as_ptr() as usize, HEAP_SIZE) }
unsafe { ALLOCATOR.init(addr_of_mut!(HEAP) as usize, HEAP_SIZE) }
}

let mut pac = hal::pac::Peripherals::take().unwrap();
Expand Down
8 changes: 4 additions & 4 deletions st7032i/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ where
}
}

impl<'a, I, W, A, D, N, DH> St7032i<'a, I, W, A, D, N, DH>
impl<I, W, A, D, N, DH> St7032i<'_, I, W, A, D, N, DH>
where
I: InstructionSet,
W: Write<A> + WriteIter<A>,
Expand Down Expand Up @@ -217,7 +217,7 @@ where
}
}

impl<'a, W, A, D, N, DH> St7032i<'a, Normal, W, A, D, N, DH>
impl<W, A, D, N, DH> St7032i<'_, Normal, W, A, D, N, DH>
where
W: Write<A> + WriteIter<A>,
A: AddressMode + Copy,
Expand All @@ -232,7 +232,7 @@ where
}
}

impl<'a, W, A, D, N, DH> St7032i<'a, Extention, W, A, D, N, DH>
impl<W, A, D, N, DH> St7032i<'_, Extention, W, A, D, N, DH>
where
W: Write<A> + WriteIter<A>,
A: AddressMode + Copy,
Expand Down Expand Up @@ -282,7 +282,7 @@ where
}
}

impl<'a, W, A, D, N, DH> core::fmt::Write for St7032i<'a, Normal, W, A, D, N, DH>
impl<W, A, D, N, DH> core::fmt::Write for St7032i<'_, Normal, W, A, D, N, DH>
where
W: Write<A> + WriteIter<A>,
A: AddressMode + Copy,
Expand Down

0 comments on commit 281e629

Please sign in to comment.