simplify run

This commit is contained in:
Franz Dietrich 2024-01-20 16:02:18 +01:00
parent cad7822c16
commit f5e2be9651

View File

@ -1,3 +1,4 @@
use anyhow::Context;
use sieverman::ConnectionInfo;
use tracing::info;
@ -12,13 +13,7 @@ pub(crate) async fn run(
info!("connecting…");
let future_info = info.connect();
info!("waiting for the connection to be established");
let mut connected = match future_info.await {
Ok(v) => v,
Err(e) => {
info!("Failed to connect: {:?}", e);
panic!("Something went wrong");
}
};
let mut connected = future_info.await.context("Something went wrong")?;
info!("Fully read the introduction:");
to_frontend_tx
@ -27,5 +22,6 @@ pub(crate) async fn run(
))
.await
.unwrap();
Ok(())
}