diff options
Diffstat (limited to 'src/netapp.rs')
-rw-r--r-- | src/netapp.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/netapp.rs b/src/netapp.rs index 86f14fe..e49f599 100644 --- a/src/netapp.rs +++ b/src/netapp.rs @@ -27,9 +27,11 @@ type DynMsg = Box<dyn Any + Send + Sync + 'static>; type OnConnectHandler = Box<dyn Fn(NodeID, SocketAddr, bool) + Send + Sync>; type OnDisconnectHandler = Box<dyn Fn(NodeID, bool) + Send + Sync>; -pub(crate) type LocalHandler = Box<dyn Fn(DynMsg) -> Pin<Box<dyn Future<Output = DynMsg> + Sync + Send>> + Sync + Send>; +pub(crate) type LocalHandler = + Box<dyn Fn(DynMsg) -> Pin<Box<dyn Future<Output = DynMsg> + Sync + Send>> + Sync + Send>; pub(crate) type NetHandler = Box< - dyn Fn(NodeID, Bytes) -> Pin<Box<dyn Future<Output = Vec<u8>> + Sync + Send>> + Sync + Send>; + dyn Fn(NodeID, Bytes) -> Pin<Box<dyn Future<Output = Vec<u8>> + Sync + Send>> + Sync + Send, +>; pub(crate) struct Handler { pub(crate) local_handler: LocalHandler, @@ -132,7 +134,7 @@ impl NetApp { let netapp2 = netapp.clone(); netapp.add_msg_handler::<HelloMessage, _, _>(move |from: NodeID, msg: HelloMessage| { netapp2.handle_hello_message(from, msg); - async { } + async {} }); netapp |