From feaeee1e835bf3e2a6b36fc8d2d45d4cbc5c27a3 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sun, 17 Sep 2023 18:47:22 -0500 Subject: stm32: misc. cleanup --- embassy-stm32/src/rtc/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'embassy-stm32/src') diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs index a588c8b18..07b4fe1f0 100644 --- a/embassy-stm32/src/rtc/mod.rs +++ b/embassy-stm32/src/rtc/mod.rs @@ -82,8 +82,9 @@ impl core::ops::Sub for RtcInstant { } } -#[non_exhaustive] -pub struct RtcTimeProvider; +pub struct RtcTimeProvider { + _private: (), +} impl RtcTimeProvider { /// Return the current datetime. @@ -186,8 +187,8 @@ impl Rtc { } /// Acquire a [`RtcTimeProvider`] instance. - pub fn time_provider(&self) -> RtcTimeProvider { - RtcTimeProvider + pub const fn time_provider(&self) -> RtcTimeProvider { + RtcTimeProvider { _private: () } } /// Set the datetime to a new value. @@ -222,7 +223,7 @@ impl Rtc { /// /// Will return an `RtcError::InvalidDateTime` if the stored value in the system is not a valid [`DayOfWeek`]. pub fn now(&self) -> Result { - RtcTimeProvider.now() + self.time_provider().now() } /// Check if daylight savings time is active. -- cgit