aboutsummaryrefslogtreecommitdiff
path: root/p2p/examples/tokio-example
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/examples/tokio-example')
-rw-r--r--p2p/examples/tokio-example/src/main.rs10
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;