Skip to content

Commit

Permalink
fix: getting reference instead of value in PluginsManager::declare_st…
Browse files Browse the repository at this point in the history
…atic_plugin

Signed-off-by: Gabriele Baldoni <[email protected]>
  • Loading branch information
gabrik committed Sep 13, 2024
1 parent aa1f703 commit e12b3a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions plugins/zenoh-plugin-storage-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<MemoryBackend, &str>(MEMORY_BACKEND_NAME, true);
let mut plugins_manager = PluginsManager::dynamic(lib_loader.clone(), BACKEND_LIB_PREFIX);
plugins_manager.declare_static_plugin::<MemoryBackend, &str>(MEMORY_BACKEND_NAME, true);

let session = Arc::new(zenoh::session::init(runtime.clone()).wait()?);

Expand Down
5 changes: 2 additions & 3 deletions plugins/zenoh-plugin-trait/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ impl<StartArgs: PluginStartArgs + 'static, Instance: PluginInstance + 'static>
P: Plugin<StartArgs = StartArgs, Instance = Instance> + Send + Sync,
S: Into<String>,
>(
mut self,
&mut self,
id: S,
required: bool,
) -> Self {
) {
let id = id.into();
let plugin_loader: StaticPlugin<StartArgs, Instance, P> =
StaticPlugin::new(id.clone(), required);
Expand All @@ -152,7 +152,6 @@ impl<StartArgs: PluginStartArgs + 'static, Instance: PluginInstance + 'static>
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
Expand Down

0 comments on commit e12b3a0

Please sign in to comment.