summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@ifm.com>2022-07-06 11:40:40 +0200
committerMatthias Beyer <matthias.beyer@ifm.com>2022-07-06 11:54:10 +0200
commit9b9af1a18bb3dc981fe2b96c92fcd0b51b8e1361 (patch)
tree96e82fc7f89fa87fec0b53ff75fe8048dad6a69a
parent50bac01fe3781a3948ab326395993e01057b79fa (diff)
Remove borrow of Box
This removes the borrowed box as a parameter and lets us pass a trait object here. Fixes lint: clippy::borrowed_box Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rw-r--r--crates/core/tedge_core/src/configuration.rs4
-rw-r--r--crates/core/tedge_core/src/lib.rs2
-rw-r--r--crates/core/tedge_core/src/reactor.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/crates/core/tedge_core/src/configuration.rs b/crates/core/tedge_core/src/configuration.rs
index bcea89a2..987be958 100644
--- a/crates/core/tedge_core/src/configuration.rs
+++ b/crates/core/tedge_core/src/configuration.rs
@@ -77,7 +77,7 @@ impl InstanceConfiguration {
pub async fn verify_with_builder(
&self,
plugin_name: &str,
- builder: &Box<dyn PluginBuilder<PluginDirectory>>,
+ builder: &dyn PluginBuilder<PluginDirectory>,
root_config_path: &Path,
) -> Result<toml::Value, PluginConfigurationError> {
match self {
@@ -94,7 +94,7 @@ impl InstanceConfiguration {
InstanceConfiguration::ConfigFilePath(path) => {
async fn inner(
plugin_name: &str,
- builder: &Box<dyn PluginBuilder<PluginDirectory>>,
+ builder: &dyn PluginBuilder<PluginDirectory>,
root_config_path: &Path,
path: &Path,
) -> Result<toml::Value, PluginConfigurationError> {
diff --git a/crates/core/tedge_core/src/lib.rs b/crates/core/tedge_core/src/lib.rs
index 4263211f..bc34a3d5 100644
--- a/crates/core/tedge_core/src/lib.rs
+++ b/crates/core/tedge_core/src/lib.rs
@@ -117,7 +117,7 @@ impl TedgeApplication {
debug!("Verifying {}", plugin_cfg.kind().as_ref());
let res = plugin_cfg
.configuration()
- .verify_with_builder(&plugin_name, builder, self.config_path())
+ .verify_with_builder(&plugin_name, &**builder, self.config_path())
.await;
Ok(res?)
diff --git a/crates/core/tedge_core/src/reactor.rs b/crates/core/tedge_core/src/reactor.rs
index 1824a216..07d06c01 100644
--- a/crates/core/tedge_core/src/reactor.rs
+++ b/crates/core/tedge_core/src/reactor.rs
@@ -340,7 +340,7 @@ impl Reactor {
)?;
let config = match config
- .verify_with_builder(plugin_name, builder, root_config_path)
+ .verify_with_builder(plugin_name, &**builder, root_config_path)
.instrument(trace_span!("core.config_verification"))
.await
{