Skip to content

Commit 25fe762

Browse files
committed
Cleanup
1 parent 8c23103 commit 25fe762

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

bin/router/src/plugins/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use hive_router_plan_executor::plugin_trait::{RouterPluginBoxed, RouterPluginWit
55
use serde_json::Value;
66
use tracing::info;
77

8-
type PluginFactory = Box<dyn Fn(Value) -> Result<Option<RouterPluginBoxed>, serde_json::Error>>;
8+
type PluginFactory = Box<dyn Fn(Value) -> serde_json::Result<Option<RouterPluginBoxed>>>;
99

1010
pub struct PluginRegistry {
1111
map: HashMap<&'static str, PluginFactory>,

lib/executor/src/plugins/plugin_trait.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,8 @@ where
8585
Self: RouterPlugin,
8686
{
8787
fn plugin_name() -> &'static str;
88-
type Config: Send + Sync + DeserializeOwned;
88+
type Config: DeserializeOwned;
8989
fn from_config(config: Self::Config) -> Option<Self>;
90-
fn from_config_value(value: serde_json::Value) -> serde_json::Result<Option<Box<Self>>>
91-
where
92-
Self: Sized,
93-
{
94-
let config: Self::Config = serde_json::from_value(value)?;
95-
let plugin = Self::from_config(config);
96-
match plugin {
97-
None => Ok(None),
98-
Some(plugin) => Ok(Some(Box::new(plugin))),
99-
}
100-
}
10190
}
10291

10392
#[async_trait::async_trait]

0 commit comments

Comments
 (0)