Skip to content

Commit e04762f

Browse files
committed
Convert more unwraps to expects
These aren't recoverable, so let's just make sure we explain why we think so.
1 parent e3679bf commit e04762f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rustygear/src/client.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,11 @@ impl Client {
782782
let rt = tokio::runtime::Builder::new_current_thread()
783783
.build()
784784
.expect("Tokio builder should not panic");
785-
let res = func_clone.lock().unwrap()(&mut job);
785+
let res = func_clone
786+
.lock()
787+
.expect("This should be the only place where we ever hold this lock.")(
788+
&mut job,
789+
);
786790
match res {
787791
Err(_) => {
788792
if let Err(e) = rt.block_on(job.work_fail()) {
@@ -797,7 +801,7 @@ impl Client {
797801
};
798802
})
799803
.await
800-
.unwrap();
804+
.expect("Function may panic.");
801805
}
802806
});
803807
Ok(self)

0 commit comments

Comments
 (0)