From 8fd8ef9ca7f9b5e43ba983f506274ff05665f99b Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 11 Apr 2023 23:00:34 +0200 Subject: [PATCH] nrf/timer: make `cc()` borrows less strict. --- embassy-nrf/src/timer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index 48b4f1b5..e9d2132c 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs @@ -213,13 +213,13 @@ impl<'d, T: Instance> Timer<'d, T> { /// /// # Panics /// Panics if `n` >= the number of CC registers this timer has (4 for a normal timer, 6 for an extended timer). - pub fn cc(&mut self, n: usize) -> Cc { + pub fn cc(&self, n: usize) -> Cc<'d, T> { if n >= T::CCS { panic!("Cannot get CC register {} of timer with {} CC registers.", n, T::CCS); } Cc { n, - _p: self._p.reborrow(), + _p: unsafe { self._p.clone_unchecked() }, } } }