From e12b3a00161bf414cd9e3d34d1ab524dcd132266 Mon Sep 17 00:00:00 2001 From: Gabriele Baldoni Date: Fri, 13 Sep 2024 14:13:33 +0200 Subject: [PATCH] fix: getting reference instead of value in PluginsManager::declare_static_plugin Signed-off-by: Gabriele Baldoni --- plugins/zenoh-plugin-storage-manager/src/lib.rs | 5 ++--- plugins/zenoh-plugin-trait/src/manager.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/zenoh-plugin-storage-manager/src/lib.rs b/plugins/zenoh-plugin-storage-manager/src/lib.rs index c683f1b2e4..d29c2987f2 100644 --- a/plugins/zenoh-plugin-storage-manager/src/lib.rs +++ b/plugins/zenoh-plugin-storage-manager/src/lib.rs @@ -126,9 +126,8 @@ impl StorageRuntimeInner { } = config; let lib_loader = LibLoader::new(backend_search_dirs); - let plugins_manager = - PluginsManager::dynamic(lib_loader.clone(), BACKEND_LIB_PREFIX) - .declare_static_plugin::(MEMORY_BACKEND_NAME, true); + let mut plugins_manager = PluginsManager::dynamic(lib_loader.clone(), BACKEND_LIB_PREFIX); + plugins_manager.declare_static_plugin::(MEMORY_BACKEND_NAME, true); let session = Arc::new(zenoh::session::init(runtime.clone()).wait()?); diff --git a/plugins/zenoh-plugin-trait/src/manager.rs b/plugins/zenoh-plugin-trait/src/manager.rs index 4776aa31a3..bc0915f956 100644 --- a/plugins/zenoh-plugin-trait/src/manager.rs +++ b/plugins/zenoh-plugin-trait/src/manager.rs @@ -132,10 +132,10 @@ impl P: Plugin + Send + Sync, S: Into, >( - mut self, + &mut self, id: S, required: bool, - ) -> Self { + ) { let id = id.into(); let plugin_loader: StaticPlugin = StaticPlugin::new(id.clone(), required); @@ -152,7 +152,6 @@ impl self.plugins.last().unwrap().id(), self.plugins.last().unwrap().name() ); - self } /// Add dynamic plugin to the manager by name, automatically prepending the default library prefix