From f97f76c01ef12a76afa4a1edf271897b3bc0e267 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 7 Oct 2023 12:12:40 -0500 Subject: [PATCH] Fix io-uring initialization --- src/main.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 457cd30..7bf001d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,22 +1,20 @@ fn main() -> color_eyre::Result<()> { - #[cfg(not(feature = "io-uring"))] - return run_tokio(); - - #[cfg(feature = "io-uring")] - return run_tokio_uring(); + run() } #[cfg(feature = "io-uring")] -fn run_tokio_uring() -> color_eyre::Result<()> { - tokio_uring::start(run()) +fn run() -> color_eyre::Result<()> { + tokio_uring::start(async move { + pict_rs::PictRsConfiguration::build_default()? + .install_tracing()? + .install_metrics()? + .run() + .await + }) } #[cfg(not(feature = "io-uring"))] #[tokio::main] -async fn run_tokio() -> color_eyre::Result<()> { - run().await -} - async fn run() -> color_eyre::Result<()> { pict_rs::PictRsConfiguration::build_default()? .install_tracing()?