From ceeb57dec5e7212cb7826278dfcb8ee76ae02a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 13 Sep 2023 14:46:06 +0200 Subject: [PATCH] style(scheduler): inline closure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Kröning --- src/scheduler/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/scheduler/mod.rs b/src/scheduler/mod.rs index f937515c20..e55032ce60 100644 --- a/src/scheduler/mod.rs +++ b/src/scheduler/mod.rs @@ -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!( @@ -200,9 +200,7 @@ impl PerCoreScheduler { self.custom_wakeup(task); } } - }; - - without_interrupts(closure); + }); self.reschedule(); unreachable!()