From 0992071a7f1a36424bcfaf1fbc84541ea041df1a Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 11 Apr 2024 10:19:20 +0200 Subject: add support for tokio & improve net crate api --- p2p/examples/chat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'p2p/examples/chat.rs') diff --git a/p2p/examples/chat.rs b/p2p/examples/chat.rs index cc822d9..4eafb07 100644 --- a/p2p/examples/chat.rs +++ b/p2p/examples/chat.rs @@ -121,7 +121,7 @@ fn main() { let ex = Arc::new(Executor::new()); // Create a new Backend - let backend = Backend::new(&key_pair, config, ex.clone()); + let backend = Backend::new(&key_pair, config, ex.clone().into()); let (ctrlc_s, ctrlc_r) = channel::unbounded(); let handle = move || ctrlc_s.try_send(()).unwrap(); @@ -133,7 +133,7 @@ fn main() { let username = cli.username; // Attach the ChatProtocol - let c = move |peer| ChatProtocol::new(&username, peer, ex_cloned.clone()); + let c = move |peer| ChatProtocol::new(&username, peer, ex_cloned.clone().into()); backend.attach_protocol::(c).await.unwrap(); // Run the backend -- cgit v1.2.3