diff --git a/codex-rs/core/src/realtime_conversation.rs b/codex-rs/core/src/realtime_conversation.rs index cf7f008a60..13727d0b26 100644 --- a/codex-rs/core/src/realtime_conversation.rs +++ b/codex-rs/core/src/realtime_conversation.rs @@ -393,15 +393,14 @@ async fn stop_conversation_state( state.input_task.abort(); let _ = state.input_task.await; - match state.fanout_task.take() { - Some(fanout_task) => match fanout_task_stop { + if let Some(fanout_task) = state.fanout_task.take() { + match fanout_task_stop { RealtimeFanoutTaskStop::Abort => { fanout_task.abort(); let _ = fanout_task.await; } RealtimeFanoutTaskStop::Detach => {} - }, - None => {} + } } }