refactor: remove many unwrap calls

This commit is contained in:
Nova
2023-01-25 11:50:53 -05:00
parent 41ede661f7
commit 742780e34e
26 changed files with 163 additions and 133 deletions

View File

@@ -6,6 +6,7 @@ use std::sync::atomic::AtomicU64;
use std::sync::Arc;
use tokio::net::UnixListener;
use tokio::task::JoinHandle;
use tracing::error;
pub static FRAME: AtomicU64 = AtomicU64::new(0);
@@ -20,7 +21,9 @@ impl EventLoop {
let join_handle = task::new(|| "event loop", async move {
loop {
let Ok((socket, _)) = socket.accept().await else { continue };
Client::from_connection(socket);
if let Err(e) = Client::from_connection(socket) {
error!(?e, "Unable to create client from connection");
}
}
})?;
let event_loop = Arc::new(EventLoop { join_handle });