diff --git a/iroh/src/node/builder.rs b/iroh/src/node/builder.rs index c0668c7843..b7f5a9aded 100644 --- a/iroh/src/node/builder.rs +++ b/iroh/src/node/builder.rs @@ -57,7 +57,10 @@ const MAX_CONNECTIONS: u32 = 1024; const MAX_STREAMS: u64 = 10; pub(super) type ProtocolMap = Arc>>>; -type ProtocolBuilders = Vec<(&'static [u8], Box) -> Arc>)>; +type ProtocolBuilders = Vec<( + &'static [u8], + Box) -> Arc + Send + 'static>, +)>; /// Builder for the [`Node`]. /// @@ -358,7 +361,7 @@ where pub fn accept( mut self, alpn: &'static [u8], - protocol: impl FnOnce(Node) -> Arc + 'static, + protocol: impl FnOnce(Node) -> Arc + Send + 'static, ) -> Self { self.protocols.push((alpn, Box::new(protocol))); self