aboutsummaryrefslogtreecommitdiff
path: root/src/tq.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-03-01 17:44:02 +0000
committerGitHub <noreply@github.com>2022-03-01 17:44:02 +0000
commit2e4cbe9df595c2c4cb90c788030351a7f91339f6 (patch)
tree2e1bf40e2eaeeb4b58c996c1659c8a7429e2a518 /src/tq.rs
parent57da1e0403510cafbdcf88e402b39ae6d3bf323e (diff)
parent5ed93bd1bf056f1d2b8632502300d7488df4e9df (diff)
Merge #617
617: Clippy with pedantic suggestions r=korken89 a=AfoHT Co-authored-by: Henrik Tjäder <henrik@grepit.se>
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(),