simplify run
This commit is contained in:
parent
cad7822c16
commit
f5e2be9651
@ -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(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user