From 5ed93bd1bf056f1d2b8632502300d7488df4e9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Fri, 18 Feb 2022 19:38:48 +0100 Subject: Clippy with pedantic suggestions --- src/tq.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/tq.rs') diff --git a/src/tq.rs b/src/tq.rs index 9033022..0f585ba 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -17,7 +17,7 @@ where /// # Safety /// /// Writing to memory with a transmute in order to enable - /// interrupts of the SysTick timer + /// interrupts of the ``SysTick`` timer /// /// Enqueue a task without checking if it is full #[inline] @@ -33,11 +33,8 @@ where { // Check if the top contains a non-empty element and if that element is // greater than nr - let if_heap_max_greater_than_nr = self - .0 - .peek() - .map(|head| nr.instant < head.instant) - .unwrap_or(true); + let if_heap_max_greater_than_nr = + self.0.peek().map_or(true, |head| nr.instant < head.instant); if if_heap_max_greater_than_nr { if Mono::DISABLE_INTERRUPT_ON_EMPTY_QUEUE && self.0.is_empty() { @@ -92,7 +89,7 @@ where } } - /// Dequeue a task from the TimerQueue + /// Dequeue a task from the ``TimerQueue`` pub fn dequeue(&mut self, disable_interrupt: F, mono: &mut Mono) -> Option<(Task, u8)> where F: FnOnce(), -- cgit v1.2.3