Skip to content

Commit c0cea62

Browse files
committed
Disable is_some_and feature
1 parent 498fdb8 commit c0cea62

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(naked_functions)]
1515
#![feature(specialization)]
1616
#![feature(strict_provenance)]
17-
#![feature(is_some_and)]
1817
#![cfg_attr(target_os = "none", no_std)]
1918
#![cfg_attr(target_os = "none", feature(custom_test_frameworks))]
2019
#![cfg_attr(all(target_os = "none", test), test_runner(crate::test_runner))]

src/scheduler/task.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ impl TaskHandlePriorityQueue {
168168
/// Checks if the given task is in the queue. Returns `true` if the task
169169
/// was found.
170170
pub fn contains(&self, task: TaskHandle) -> bool {
171-
self.queues[task.priority.into() as usize]
172-
.as_ref()
173-
.is_some_and(|queue| queue.iter().any(|queued| queued.id == task.id))
171+
matches!(self.queues[task.priority.into() as usize]
172+
.as_ref(), Some(queue) if queue.iter().any(|queued| queued.id == task.id))
174173
}
175174

176175
/// Add a task handle by its priority to the queue

src/synch/futex.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn futex_wait(address: &AtomicU32, expected: u32, timeout: Option<u64>, flag
5656
scheduler.reschedule();
5757

5858
let mut parking_lot = PARKING_LOT.lock();
59-
if wakeup_time.is_some_and(|t| t <= get_timer_ticks()) {
59+
if matches!(wakeup_time, Some(t) if t <= get_timer_ticks()) {
6060
let mut wakeup = true;
6161
// Timeout occurred, try to remove ourselves from the waiting queue.
6262
if let Entry::Occupied(mut queue) = parking_lot.entry(addr(address)) {
@@ -74,9 +74,8 @@ pub fn futex_wait(address: &AtomicU32, expected: u32, timeout: Option<u64>, flag
7474
}
7575
} else {
7676
// If we are not in the waking queue, this must have been a wakeup.
77-
let wakeup = !parking_lot
78-
.get(&addr(address))
79-
.is_some_and(|queue| queue.contains(handle));
77+
let wakeup = !matches!(parking_lot
78+
.get(&addr(address)), Some(queue) if queue.contains(handle));
8079

8180
if wakeup {
8281
return 0;

0 commit comments

Comments
 (0)