Skip to content

Commit

Permalink
style(scheduler): inline closure
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Sep 18, 2023
1 parent cbedc0f commit 8d65c0f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl PerCoreScheduler {

/// Terminate the current task on the current core.
pub fn exit(&mut self, exit_code: i32) -> ! {
let closure = || {
without_interrupts(|| {
// Get the current task.
let mut current_task_borrowed = self.current_task.borrow_mut();
assert_ne!(
Expand All @@ -200,9 +200,7 @@ impl PerCoreScheduler {
self.custom_wakeup(task);
}
}
};

without_interrupts(closure);
});

self.reschedule();
unreachable!()
Expand Down

0 comments on commit 8d65c0f

Please sign in to comment.