From 37e5b087a7f7faeec09f8be4c1153ae28bf91279 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Mon, 18 Aug 2025 16:37:07 -0700 Subject: [PATCH] chore: prefer returning Err to expect() (#2389) Letting the caller deal with `Err` seems preferable to using `expect()` (which would `panic!()`), particularly given that the function already returns `Result`. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/2389). * #2399 * #2398 * #2396 * #2395 * #2394 * #2393 * __->__ #2389 --- codex-rs/login/src/server.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codex-rs/login/src/server.rs b/codex-rs/login/src/server.rs index ef85df69..19ef4c1c 100644 --- a/codex-rs/login/src/server.rs +++ b/codex-rs/login/src/server.rs @@ -59,10 +59,9 @@ pub struct LoginServer { impl LoginServer { pub fn block_until_done(self) -> io::Result<()> { - #[expect(clippy::expect_used)] self.server_handle .join() - .expect("can't join on the server thread") + .map_err(|err| io::Error::other(format!("login server thread panicked: {err:?}")))? } pub fn cancel(&self) {