Skip to content

Commit 79261f4

Browse files
authored
stun: simplify connection retrieval (#731)
Signed-off-by: Xiaobo Liu <[email protected]>
1 parent 735a0d8 commit 79261f4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stun/src/client.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,7 @@ impl Client {
394394
self.handler_tx = Some(Arc::clone(&handler_tx));
395395
self.close_tx = Some(close_tx);
396396

397-
let conn = if let Some(conn) = &self.settings.c {
398-
Arc::clone(conn)
399-
} else {
400-
return Err(Error::ErrNoConnection);
401-
};
397+
let conn = self.settings.c.clone().ok_or(Error::ErrNoConnection)?;
402398

403399
Client::start(
404400
self.settings.c.clone(),

0 commit comments

Comments
 (0)