diff --git a/examples/ping-pong-encrypted/src/client.rs b/examples/ping-pong-encrypted/src/client.rs index 8cff096331..6b8fbb8eb2 100644 --- a/examples/ping-pong-encrypted/src/client.rs +++ b/examples/ping-pong-encrypted/src/client.rs @@ -36,10 +36,7 @@ pub async fn start_client(address: &str, k_pub: String) -> Result<(), Error> { "CLIENT: Sending encrypted Ping to server with nonce: {}", ping_nonce ); - match sender.send(ping_frame.into()).await { - Ok(_) => {} - Err(_) => return Err(Error::Sender), - } + sender.send(ping_frame.into()).await.map_err(|_| Error::Sender)?; // ok, we have successfully sent the ping message // now it's time to receive and verify the pong response