Skip to content

Commit

Permalink
clippy: replace usage of legacy numeric method with constant
Browse files Browse the repository at this point in the history
  • Loading branch information
ithinuel committed Jun 29, 2024
1 parent 94fb3bd commit ef1e87e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rp2040-hal/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
}

Expand Down

0 comments on commit ef1e87e

Please sign in to comment.