Skip to content

Commit 5a933b1

Browse files
committed
improve readability
1 parent 0d9b8ac commit 5a933b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/scheduler/scheduler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ impl Scheduler {
9595

9696
/// determine the next task, which is ready and priority is a greater than or equal to prio
9797
fn get_next_task(&mut self, prio: TaskPriority) -> Option<Rc<RefCell<Task>>> {
98-
let lsb = self.prio_bitmap.lowest_one();
9998
let mut task = None;
10099

101-
if let Some(i) = lsb {
102-
let i = i as usize;
100+
if let Some(i) = self.prio_bitmap.lowest_one() {
101+
let i: usize = i.try_into().unwrap();
103102
if i <= prio.into().into() {
104103
task = self.ready_queues[i].pop();
105104

0 commit comments

Comments
 (0)