aboutsummaryrefslogtreecommitdiff
path: root/src/tq.rs
diff options
context:
space:
mode:
authorHenrik Tjäder <henrik@grepit.se>2022-02-18 19:38:48 +0100
committerHenrik Tjäder <henrik@grepit.se>2022-02-22 18:56:21 +0100
commit5ed93bd1bf056f1d2b8632502300d7488df4e9df (patch)
tree2e1bf40e2eaeeb4b58c996c1659c8a7429e2a518 /src/tq.rs
parent57da1e0403510cafbdcf88e402b39ae6d3bf323e (diff)
Clippy with pedantic suggestions
Diffstat (limited to 'src/tq.rs')
-rw-r--r--src/tq.rs11
1 files changed, 4 insertions, 7 deletions
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<F>(&mut self, disable_interrupt: F, mono: &mut Mono) -> Option<(Task, u8)>
where
F: FnOnce(),