We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7392d2 commit f6cf722Copy full SHA for f6cf722
turn/src/client/mod.rs
@@ -150,14 +150,12 @@ impl RelayConnObserver for ClientInternal {
150
}
151
152
// wait_for_result waits for the transaction result
153
- if let Some(mut result_ch_rx) = result_ch_rx {
154
- match result_ch_rx.recv().await {
155
- Some(tr) => Ok(tr),
156
- None => Err(Error::ErrTransactionClosed),
157
- }
158
- } else {
159
- Err(Error::ErrWaitForResultOnNonResultTransaction)
160
+ let mut result_ch_rx = result_ch_rx.ok_or(Error::ErrWaitForResultOnNonResultTransaction)?;
+ let tr = result_ch_rx
+ .recv()
+ .await
+ .ok_or(Error::ErrTransactionClosed)?;
+ Ok(tr)
161
162
163
0 commit comments