From 6c929f7ddcc5cc5d2be13ce11d119cec2faa70b7 Mon Sep 17 00:00:00 2001 From: Karolin Varner Date: Sat, 2 Aug 2025 18:34:28 +0200 Subject: [PATCH] chore(rp): Simplify error handling in exchange() --- rp/src/exchange.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/rp/src/exchange.rs b/rp/src/exchange.rs index 7bda9b7..2eaef5c 100644 --- a/rp/src/exchange.rs +++ b/rp/src/exchange.rs @@ -530,24 +530,5 @@ pub async fn exchange(options: ExchangeOptions) -> Result<()> { } log::info!("Starting to perform rosenpass key exchanges!"); - let out = srv.event_loop(); - - match out { - Ok(_) => Ok(()), - Err(e) => { - // Check if the returned error is actually EINTR, in which case, the run actually - // succeeded. - let is_ok = if let Some(e) = e.root_cause().downcast_ref::() { - matches!(e.kind(), std::io::ErrorKind::Interrupted) - } else { - false - }; - - if is_ok { - Ok(()) - } else { - Err(e) - } - } - } + srv.event_loop() }