Skip to content

Commit

Permalink
Merge pull request #779 from jannic/clippy
Browse files Browse the repository at this point in the history
Fix some more nightly clippy warnings
  • Loading branch information
ithinuel authored Mar 3, 2024
2 parents c859b7f + 745c9dc commit f1a98fd
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 8 deletions.
7 changes: 7 additions & 0 deletions rp2040-hal/src/async_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ pub(crate) mod sealed {
pub struct IrqWaker {
waker: Mutex<Cell<Option<Waker>>>,
}

impl Default for IrqWaker {
fn default() -> Self {
Self::new()
}
}

impl IrqWaker {
pub const fn new() -> Self {
Self {
Expand Down
4 changes: 0 additions & 4 deletions rp2040-hal/src/clocks/clock_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ use crate::{
bank0::{Gpio20, Gpio22},
FunctionClock, Pin, PullNone, PullType,
},
pll::{Locked, PhaseLockedLoop},
rosc::{Enabled, RingOscillator},
typelevel::Sealed,
xosc::{CrystalOscillator, Stable},
};
use pac::{PLL_SYS, PLL_USB};

pub(crate) type PllSys = PhaseLockedLoop<Locked, PLL_SYS>;
impl Sealed for PllSys {}
Expand Down
6 changes: 6 additions & 0 deletions rp2040-hal/src/multicore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ pub struct Stack<const SIZE: usize> {
pub mem: [usize; SIZE],
}

impl<const SIZE: usize> Default for Stack<SIZE> {
fn default() -> Self {
Self::new()
}
}

impl<const SIZE: usize> Stack<SIZE> {
/// Construct a stack of length SIZE, initialized to 0
pub const fn new() -> Stack<SIZE> {
Expand Down
2 changes: 1 addition & 1 deletion rp2040-hal/src/pll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See [Chapter 2 Section 18](https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf) for more details

use core::{
convert::{Infallible, TryInto},
convert::Infallible,
marker::PhantomData,
ops::{Deref, Range, RangeInclusive},
};
Expand Down
2 changes: 1 addition & 1 deletion rp2040-hal/src/rtc/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct DateTime {
pub month: u8,
/// 1..28,29,30,31 depending on month
pub day: u8,
///
/// The day of week
pub day_of_week: DayOfWeek,
/// 0..23
pub hour: u8,
Expand Down
6 changes: 6 additions & 0 deletions rp2040-hal/src/sio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@ pub struct LaneCtrl {
pub shift: u8,
}

impl Default for LaneCtrl {
fn default() -> Self {
Self::new()
}
}

impl LaneCtrl {
/// Default configuration. Normal operation, unsigned, mask keeps all bits, no shift.
pub const fn new() -> Self {
Expand Down
2 changes: 1 addition & 1 deletion rp2040-hal/src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
//! ```
use core::cell::RefCell;
use critical_section::{self, Mutex};
use critical_section::Mutex;

use usb_device::{
bus::{PollResult, UsbBus as UsbBusTrait},
Expand Down
6 changes: 6 additions & 0 deletions rp2040-hal/src/vector_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ pub struct VectorTable {
table: [Vector; 48],
}

impl Default for VectorTable {
fn default() -> Self {
Self::new()
}
}

impl VectorTable {
/// Create a new vector table. All entries will point to 0 - you must call init()
/// on this to copy the current vector table before setting it as active
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/src/xosc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Crystal Oscillator (XOSC)
// See [Chapter 2 Section 16](https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf) for more details

use core::convert::TryInto;
use core::{convert::Infallible, ops::RangeInclusive};

use fugit::HertzU32;
Expand Down

0 comments on commit f1a98fd

Please sign in to comment.