From b57f3cad31215f153438723a7bb692596727269f Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Fri, 31 May 2024 16:56:01 +0900 Subject: [PATCH] Remove unnecessary unwrap in error handling --- rustygear/src/client.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rustygear/src/client.rs b/rustygear/src/client.rs index 2654901..039fb58 100644 --- a/rustygear/src/client.rs +++ b/rustygear/src/client.rs @@ -446,13 +446,17 @@ impl Client { handler.call(frame) } }; - if let Err(e) = response { - error!("conn dropped?: {}", e); - break; - } - if let Err(_) = tx.send(response.unwrap()).await - { - error!("receiver dropped") + match response { + Err(e) => { + error!("conn dropped?: {}", e); + break; + } + Ok(response) => { + if let Err(_) = tx.send(response).await + { + error!("receiver dropped") + } + } } } reader_conns