From eb68e0518a8711a8c9951e32660d3f7dbc0553c8 Mon Sep 17 00:00:00 2001 From: jlanson Date: Wed, 21 Aug 2024 16:23:27 -0400 Subject: [PATCH] fix clippy --- hipcheck/src/main.rs | 23 +++++++++++++---------- hipcheck/src/plugin/mod.rs | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/hipcheck/src/main.rs b/hipcheck/src/main.rs index be9cde66..42141e9c 100644 --- a/hipcheck/src/main.rs +++ b/hipcheck/src/main.rs @@ -39,7 +39,7 @@ use crate::cache::HcCache; use crate::context::Context as _; use crate::error::Error; use crate::error::Result; -use crate::plugin::{HcPluginCore, Plugin, PluginExecutor}; +use crate::plugin::{HcPluginCore, Plugin, PluginExecutor, PluginWithConfig}; use crate::session::session::Session; use crate::setup::{resolve_and_transform_source, SourceType}; use crate::shell::verbosity::Verbosity; @@ -642,15 +642,18 @@ fn cmd_plugin() { let rt = Runtime::new().unwrap(); rt.block_on(async move { println!("Started executor"); - let mut core = - match HcPluginCore::new(plugin_executor, vec![(plugin, serde_json::json!(null))]).await - { - Ok(c) => c, - Err(e) => { - println!("{e}"); - return; - } - }; + let mut core = match HcPluginCore::new( + plugin_executor, + vec![PluginWithConfig(plugin, serde_json::json!(null))], + ) + .await + { + Ok(c) => c, + Err(e) => { + println!("{e}"); + return; + } + }; match core.run().await { Ok(_) => { println!("HcCore run completed"); diff --git a/hipcheck/src/plugin/mod.rs b/hipcheck/src/plugin/mod.rs index c555086b..e552de1d 100644 --- a/hipcheck/src/plugin/mod.rs +++ b/hipcheck/src/plugin/mod.rs @@ -80,7 +80,7 @@ impl HcPluginCore { } // @Temporary pub async fn run(&mut self) -> Result<()> { - let channel = self.plugins.get_mut(&"rand_data".to_owned()).unwrap(); + let channel = self.plugins.get_mut("rand_data").unwrap(); match channel .send(Query { id: 1,