diff --git a/zenoh/src/net/routing/dispatcher/face.rs b/zenoh/src/net/routing/dispatcher/face.rs index 91ebe54c57..fcf6d3c302 100644 --- a/zenoh/src/net/routing/dispatcher/face.rs +++ b/zenoh/src/net/routing/dispatcher/face.rs @@ -126,7 +126,7 @@ impl Primitives for Face { } zenoh_protocol::network::DeclareBody::DeclareSubscriber(m) => { declare_subscription( - &ctrl_lock, + ctrl_lock.as_ref(), &self.tables, &mut self.state.clone(), &m.wire_expr, @@ -136,7 +136,7 @@ impl Primitives for Face { } zenoh_protocol::network::DeclareBody::UndeclareSubscriber(m) => { undeclare_subscription( - &ctrl_lock, + ctrl_lock.as_ref(), &self.tables, &mut self.state.clone(), &m.ext_wire_expr.wire_expr, @@ -145,7 +145,7 @@ impl Primitives for Face { } zenoh_protocol::network::DeclareBody::DeclareQueryable(m) => { declare_queryable( - &ctrl_lock, + ctrl_lock.as_ref(), &self.tables, &mut self.state.clone(), &m.wire_expr, @@ -155,7 +155,7 @@ impl Primitives for Face { } zenoh_protocol::network::DeclareBody::UndeclareQueryable(m) => { undeclare_queryable( - &ctrl_lock, + ctrl_lock.as_ref(), &self.tables, &mut self.state.clone(), &m.ext_wire_expr.wire_expr, diff --git a/zenoh/src/net/routing/dispatcher/pubsub.rs b/zenoh/src/net/routing/dispatcher/pubsub.rs index 8c37dcadf5..da6ae0c371 100644 --- a/zenoh/src/net/routing/dispatcher/pubsub.rs +++ b/zenoh/src/net/routing/dispatcher/pubsub.rs @@ -17,8 +17,8 @@ use super::tables::{NodeId, Route, RoutingExpr, Tables, TablesLock}; use crate::net::routing::hat::HatTrait; use std::borrow::Cow; use std::collections::HashMap; +use std::sync::Arc; use std::sync::RwLock; -use std::sync::{Arc, MutexGuard}; use zenoh_core::zread; use zenoh_protocol::core::key_expr::{keyexpr, OwnedKeyExpr}; use zenoh_protocol::network::declare::subscriber::ext::SubscriberInfo; @@ -31,7 +31,7 @@ use zenoh_protocol::{ use zenoh_sync::get_mut_unchecked; pub(crate) fn declare_subscription( - hat_code: &MutexGuard<'_, Box>, + hat_code: &(dyn HatTrait + Send + Sync), tables: &TablesLock, face: &mut Arc, expr: &WireExpr, @@ -91,7 +91,7 @@ pub(crate) fn declare_subscription( } pub(crate) fn undeclare_subscription( - hat_code: &MutexGuard<'_, Box>, + hat_code: &(dyn HatTrait + Send + Sync), tables: &TablesLock, face: &mut Arc, expr: &WireExpr, diff --git a/zenoh/src/net/routing/dispatcher/queries.rs b/zenoh/src/net/routing/dispatcher/queries.rs index d66ca7750f..db275e03de 100644 --- a/zenoh/src/net/routing/dispatcher/queries.rs +++ b/zenoh/src/net/routing/dispatcher/queries.rs @@ -19,7 +19,7 @@ use crate::net::routing::hat::HatTrait; use crate::net::routing::RoutingContext; use async_trait::async_trait; use std::collections::HashMap; -use std::sync::{Arc, MutexGuard, Weak}; +use std::sync::{Arc, Weak}; use zenoh_config::WhatAmI; use zenoh_protocol::core::key_expr::keyexpr; use zenoh_protocol::network::declare::queryable::ext::QueryableInfo; @@ -41,7 +41,7 @@ pub(crate) struct Query { } pub(crate) fn declare_queryable( - hat_code: &MutexGuard<'_, Box>, + hat_code: &(dyn HatTrait + Send + Sync), tables: &TablesLock, face: &mut Arc, expr: &WireExpr, @@ -98,7 +98,7 @@ pub(crate) fn declare_queryable( } pub(crate) fn undeclare_queryable( - hat_code: &MutexGuard<'_, Box>, + hat_code: &(dyn HatTrait + Send + Sync), tables: &TablesLock, face: &mut Arc, expr: &WireExpr,