diff options
author | hozan23 <hozan23@karyontech.net> | 2024-06-30 01:13:45 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-06-30 01:13:45 +0200 |
commit | 4dc6ae61c66d2ecedb3dbd519dde89e8afc727a9 (patch) | |
tree | d5ecff0aed228119f3cb6e21f91f4e749456f13b /p2p/examples/tokio-example/src | |
parent | 5c0abab1b7bf0f2858c451d6f0efc7ca0e138fc6 (diff) |
p2p: remove async-std from dev dependencies & clean up examples
Diffstat (limited to 'p2p/examples/tokio-example/src')
-rw-r--r-- | p2p/examples/tokio-example/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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; |