From 7aae5e3dc8b913e7369453abe8ec2416e25203f5 Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Sat, 4 May 2024 17:21:31 +0000 Subject: [PATCH] Fix some clippy lints triggered by rust beta --- rp2040-hal/src/timer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rp2040-hal/src/timer.rs b/rp2040-hal/src/timer.rs index a834b427b..23dabce58 100644 --- a/rp2040-hal/src/timer.rs +++ b/rp2040-hal/src/timer.rs @@ -292,7 +292,7 @@ pub trait Alarm: Sealed { /// called, this will trigger interrupt whenever this timestamp is reached. /// /// The RP2040 is unable to schedule an event taking place in more than - /// `u32::max_value()` microseconds. + /// `u32::MAX` microseconds. /// /// [enable_interrupt]: #method.enable_interrupt fn schedule_at(&mut self, timestamp: Instant) -> Result<(), ScheduleAlarmError>; @@ -412,13 +412,13 @@ macro_rules! impl_alarm { /// ` whenever this timestamp is reached. /// /// The RP2040 is unable to schedule an event taking place in more than - /// `u32::max_value()` microseconds. + /// `u32::MAX` microseconds. /// /// [enable_interrupt]: #method.enable_interrupt fn schedule_at(&mut self, timestamp: Instant) -> Result<(), ScheduleAlarmError> { let now = self.0.get_counter(); let duration = timestamp.ticks().saturating_sub(now.ticks()); - if duration > u32::max_value().into() { + if duration > u32::MAX.into() { return Err(ScheduleAlarmError::AlarmTooLate); } @@ -464,7 +464,7 @@ macro_rules! impl_alarm { /// Errors that can be returned from any of the `AlarmX::schedule` methods. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum ScheduleAlarmError { - /// Alarm time is too high. Should not be more than `u32::max_value()` in the future. + /// Alarm time is too high. Should not be more than `u32::MAX` in the future. AlarmTooLate, }