From 4dc6ae61c66d2ecedb3dbd519dde89e8afc727a9 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Sun, 30 Jun 2024 01:13:45 +0200 Subject: p2p: remove async-std from dev dependencies & clean up examples --- p2p/examples/tokio-example/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'p2p/examples/tokio-example/src') diff --git a/p2p/examples/tokio-example/src/main.rs b/p2p/examples/tokio-example/src/main.rs index 6a81ac6..5858e90 100644 --- a/p2p/examples/tokio-example/src/main.rs +++ b/p2p/examples/tokio-example/src/main.rs @@ -57,22 +57,22 @@ fn main() { .worker_threads(available_parallelism()) .enable_all() .build() - .unwrap(), + .expect("Build a new tokio runtime"), ); // Create a new Backend let backend = Backend::new(&key_pair, config, rt.clone().into()); let (ctrlc_s, ctrlc_r) = async_channel::unbounded(); - let handle = move || ctrlc_s.try_send(()).unwrap(); - ctrlc::set_handler(handle).unwrap(); + let handle = move || ctrlc_s.try_send(()).expect("Send ctrlc signal"); + ctrlc::set_handler(handle).expect("ctrlc set handler"); rt.block_on(async { // Run the backend - backend.run().await.unwrap(); + backend.run().await.expect("Run the backend"); // Wait for ctrlc signal - ctrlc_r.recv().await.unwrap(); + ctrlc_r.recv().await.expect("Receive ctrlc signal"); // Shutdown the backend backend.shutdown().await; -- cgit v1.2.3