Skip to content

Commit 37e5b08

Browse files
authored
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
1 parent 52f0b95 commit 37e5b08

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

codex-rs/login/src/server.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ pub struct LoginServer {
5959

6060
impl LoginServer {
6161
pub fn block_until_done(self) -> io::Result<()> {
62-
#[expect(clippy::expect_used)]
6362
self.server_handle
6463
.join()
65-
.expect("can't join on the server thread")
64+
.map_err(|err| io::Error::other(format!("login server thread panicked: {err:?}")))?
6665
}
6766

6867
pub fn cancel(&self) {

0 commit comments

Comments
 (0)