diff --git a/fastimer-driver/src/lib.rs b/fastimer-driver/src/lib.rs index 0cf2846..95131dd 100644 --- a/fastimer-driver/src/lib.rs +++ b/fastimer-driver/src/lib.rs @@ -149,7 +149,7 @@ impl MakeFastimerDelay { impl MakeDelay for MakeFastimerDelay { type Delay = Delay; - fn delay_util(&self, at: Instant) -> Self::Delay { + fn delay_until(&self, at: Instant) -> Self::Delay { self.0.delay_until(at) } diff --git a/fastimer-driver/tests/integration.rs b/fastimer-driver/tests/integration.rs index 6a26fe3..0b40cbf 100644 --- a/fastimer-driver/tests/integration.rs +++ b/fastimer-driver/tests/integration.rs @@ -21,7 +21,7 @@ use fastimer_driver::binary_heap_driver; #[track_caller] fn assert_duration_eq(actual: Duration, expected: Duration) { if expected.abs_diff(actual) > Duration::from_millis(250) { - panic!("expected: {:?}, actual: {:?}", expected, actual); + panic!("expected: {expected:?}, actual: {actual:?}"); } } diff --git a/fastimer-tokio/src/lib.rs b/fastimer-tokio/src/lib.rs index 001c44f..80104d0 100644 --- a/fastimer-tokio/src/lib.rs +++ b/fastimer-tokio/src/lib.rs @@ -34,7 +34,7 @@ mod delay { impl MakeDelay for MakeTokioDelay { type Delay = tokio::time::Sleep; - fn delay_util(&self, at: Instant) -> Self::Delay { + fn delay_until(&self, at: Instant) -> Self::Delay { tokio::time::sleep_until(tokio::time::Instant::from_std(at)) } diff --git a/fastimer/src/interval.rs b/fastimer/src/interval.rs index 7fca84e..6f3a8ad 100644 --- a/fastimer/src/interval.rs +++ b/fastimer/src/interval.rs @@ -55,7 +55,7 @@ use crate::far_future; /// struct TokioDelay; /// impl MakeDelay for TokioDelay { /// type Delay = tokio::time::Sleep; -/// fn delay_util(&self, until: Instant) -> Self::Delay { +/// fn delay_until(&self, until: Instant) -> Self::Delay { /// tokio::time::sleep_until(tokio::time::Instant::from_std(until)) /// } /// } @@ -91,7 +91,7 @@ use crate::far_future; /// struct TokioDelay; /// impl MakeDelay for TokioDelay { /// type Delay = tokio::time::Sleep; -/// fn delay_util(&self, until: Instant) -> Self::Delay { +/// fn delay_until(&self, until: Instant) -> Self::Delay { /// tokio::time::sleep_until(tokio::time::Instant::from_std(until)) /// } /// } @@ -145,7 +145,7 @@ pub fn interval(period: Duration, make_delay: D) -> Interval { /// struct TokioDelay; /// impl MakeDelay for TokioDelay { /// type Delay = tokio::time::Sleep; -/// fn delay_util(&self, until: Instant) -> Self::Delay { +/// fn delay_until(&self, until: Instant) -> Self::Delay { /// tokio::time::sleep_until(tokio::time::Instant::from_std(until)) /// } /// } @@ -168,7 +168,7 @@ pub fn interval_at(start: Instant, period: Duration, make_delay: D fn make_interval(start: Instant, period: Duration, make_delay: D) -> Interval { let deadline = start; - let delay = Box::pin(make_delay.delay_util(start)); + let delay = Box::pin(make_delay.delay_until(start)); Interval { deadline, period, @@ -267,7 +267,7 @@ impl Interval { // When we arrive here, the internal delay returned `Poll::Ready`. // Reassign the delay but do not register it. It should be registered with // the next call to `poll_tick`. - self.delay = Box::pin(self.make_delay.delay_util(next)); + self.delay = Box::pin(self.make_delay.delay_until(next)); // Return the time when we were scheduled to tick self.deadline = next; diff --git a/fastimer/src/lib.rs b/fastimer/src/lib.rs index 6b719a6..f4113db 100644 --- a/fastimer/src/lib.rs +++ b/fastimer/src/lib.rs @@ -78,11 +78,11 @@ pub trait MakeDelay { type Delay: Future + Send; /// Create a future that completes at the specified instant. - fn delay_util(&self, at: Instant) -> Self::Delay; + fn delay_until(&self, at: Instant) -> Self::Delay; /// Create a future that completes after the specified duration. fn delay(&self, duration: Duration) -> Self::Delay { - self.delay_util(make_instant_from_now(duration)) + self.delay_until(make_instant_from_now(duration)) } } diff --git a/fastimer/src/schedule/arbitrary.rs b/fastimer/src/schedule/arbitrary.rs index 4bb3446..4ed3d1b 100644 --- a/fastimer/src/schedule/arbitrary.rs +++ b/fastimer/src/schedule/arbitrary.rs @@ -80,7 +80,7 @@ pub trait ArbitraryDelayActionExt: ArbitraryDelayAction { ControlFlow::Break(()) => break, }; - if execute_or_shutdown(make_delay.delay_util(next), &mut is_shutdown) + if execute_or_shutdown(make_delay.delay_until(next), &mut is_shutdown) .await .is_break() { diff --git a/fastimer/src/schedule/simple.rs b/fastimer/src/schedule/simple.rs index 2f0df20..9be264c 100644 --- a/fastimer/src/schedule/simple.rs +++ b/fastimer/src/schedule/simple.rs @@ -166,7 +166,7 @@ pub trait SimpleActionExt: SimpleAction { if let Some(initial_delay) = initial_delay { if initial_delay > Duration::ZERO { next = make_instant_from_now(initial_delay); - if execute_or_shutdown(make_delay.delay_util(next), &mut is_shutdown) + if execute_or_shutdown(make_delay.delay_until(next), &mut is_shutdown) .await .is_break() { @@ -185,7 +185,7 @@ pub trait SimpleActionExt: SimpleAction { }; next = calculate_next_on_miss(next, period); - if execute_or_shutdown(make_delay.delay_util(next), &mut is_shutdown) + if execute_or_shutdown(make_delay.delay_until(next), &mut is_shutdown) .await .is_break() { diff --git a/fastimer/src/timeout.rs b/fastimer/src/timeout.rs index c692616..17fc27b 100644 --- a/fastimer/src/timeout.rs +++ b/fastimer/src/timeout.rs @@ -106,7 +106,7 @@ where F: IntoFuture, D: MakeDelay + ?Sized, { - let delay = make_delay.delay_util(deadline); + let delay = make_delay.delay_until(deadline); Timeout { value: future.into_future(), delay, diff --git a/fastimer/tests/common/mod.rs b/fastimer/tests/common/mod.rs index 91cec84..72e2f4c 100644 --- a/fastimer/tests/common/mod.rs +++ b/fastimer/tests/common/mod.rs @@ -24,7 +24,7 @@ pub struct MakeTokioDelay; impl MakeDelay for MakeTokioDelay { type Delay = tokio::time::Sleep; - fn delay_util(&self, at: Instant) -> Self::Delay { + fn delay_until(&self, at: Instant) -> Self::Delay { tokio::time::sleep_until(tokio::time::Instant::from_std(at)) } diff --git a/fastimer/tests/interval.rs b/fastimer/tests/interval.rs index 15c2c8b..a6a5b97 100644 --- a/fastimer/tests/interval.rs +++ b/fastimer/tests/interval.rs @@ -24,7 +24,7 @@ mod common; #[track_caller] fn assert_duration_eq(actual: Duration, expected: Duration) { if expected.abs_diff(actual) > Duration::from_millis(250) { - panic!("expected: {:?}, actual: {:?}", expected, actual); + panic!("expected: {expected:?}, actual: {actual:?}"); } } diff --git a/fastimer/tests/schedule.rs b/fastimer/tests/schedule.rs index 0249b1a..d51d1e1 100644 --- a/fastimer/tests/schedule.rs +++ b/fastimer/tests/schedule.rs @@ -58,7 +58,7 @@ async fn test_simple_action() { let shutdown = Instant::now() + Duration::from_secs(10); MySimpleAction::new("schedule_with_fixed_delay").schedule_with_fixed_delay( - MakeTokioDelay.delay_util(shutdown), + MakeTokioDelay.delay_until(shutdown), &TokioSpawn, MakeTokioDelay, initial_delay, @@ -66,7 +66,7 @@ async fn test_simple_action() { ); MySimpleAction::new("schedule_at_fixed_rate").schedule_at_fixed_rate( - MakeTokioDelay.delay_util(shutdown), + MakeTokioDelay.delay_until(shutdown), &TokioSpawn, MakeTokioDelay, initial_delay, @@ -74,6 +74,6 @@ async fn test_simple_action() { ); MakeTokioDelay - .delay_util(shutdown + Duration::from_secs(1)) + .delay_until(shutdown + Duration::from_secs(1)) .await; }