Skip to content

Commit

Permalink
Convert more unwraps to expects
Browse files Browse the repository at this point in the history
These aren't recoverable, so let's just make sure we explain why we
think so.
  • Loading branch information
SpamapS committed Jun 20, 2024
1 parent e3679bf commit e04762f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rustygear/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,11 @@ impl Client {
let rt = tokio::runtime::Builder::new_current_thread()
.build()
.expect("Tokio builder should not panic");
let res = func_clone.lock().unwrap()(&mut job);
let res = func_clone
.lock()
.expect("This should be the only place where we ever hold this lock.")(
&mut job,
);
match res {
Err(_) => {
if let Err(e) = rt.block_on(job.work_fail()) {
Expand All @@ -797,7 +801,7 @@ impl Client {
};
})
.await
.unwrap();
.expect("Function may panic.");
}
});
Ok(self)
Expand Down

0 comments on commit e04762f

Please sign in to comment.