From 0a85082d5fea074ce3235ed467d22830c2fe5c09 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Thu, 29 Feb 2024 12:41:16 +0900 Subject: [PATCH] Replace unneeded if-let with .expect() --- unified-scheduler-pool/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unified-scheduler-pool/src/lib.rs b/unified-scheduler-pool/src/lib.rs index 60cbcd626550fd..26c40e5518bc25 100644 --- a/unified-scheduler-pool/src/lib.rs +++ b/unified-scheduler-pool/src/lib.rs @@ -606,9 +606,8 @@ impl, TH: TaskHandler> ThreadManager { recv(dummy_receiver(state_machine.has_unblocked_task())) -> dummy => { assert_matches!(dummy, Err(RecvError)); - if let Some(task) = state_machine.schedule_unblocked_task() { - runnable_task_sender.send_payload(task).unwrap(); - } + let task = state_machine.schedule_unblocked_task().expect("unblocked task"); + runnable_task_sender.send_payload(task).unwrap(); }, recv(new_task_receiver) -> message => { assert!(!session_ending);