From d4634b01e3f33b3ee52b1501f5ade739a1796d08 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 25 Apr 2026 19:02:17 +0800 Subject: Remove redundant generic parameter from Program struct --- mingling_core/src/asset/dispatcher.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling_core/src/asset') diff --git a/mingling_core/src/asset/dispatcher.rs b/mingling_core/src/asset/dispatcher.rs index 72b31e9..761c399 100644 --- a/mingling_core/src/asset/dispatcher.rs +++ b/mingling_core/src/asset/dispatcher.rs @@ -6,16 +6,16 @@ use crate::{ChainProcess, Program, asset::node::Node}; /// /// Note: If you are using [mingling_macros](https://crates.io/crates/mingling_macros), /// you can use the `dispatcher!("node.subnode", CommandType => Entry)` macro to declare a `Dispatcher` -pub trait Dispatcher { +pub trait Dispatcher { /// Returns a command node for matching user input fn node(&self) -> Node; /// Returns a [ChainProcess](./enum.ChainProcess.html) based on user input arguments, /// to be sent to the specific invocation - fn begin(&self, args: Vec) -> ChainProcess; + fn begin(&self, args: Vec) -> ChainProcess; /// Clones the current dispatcher for implementing the `Clone` trait - fn clone_dispatcher(&self) -> Box>; + fn clone_dispatcher(&self) -> Box>; } impl Clone for Box> @@ -27,11 +27,11 @@ where } } -impl Program { +impl Program { /// Adds a dispatcher to the program. pub fn with_dispatcher(&mut self, dispatcher: Disp) where - Disp: Dispatcher + Send + Sync + 'static, + Disp: Dispatcher + Send + Sync + 'static, { self.dispatcher.push(Box::new(dispatcher)); } @@ -39,7 +39,7 @@ impl Program { /// Add some dispatchers to the program. pub fn with_dispatchers(&mut self, dispatchers: D) where - D: Into>, + D: Into>, { let dispatchers = dispatchers.into(); self.dispatcher.extend(dispatchers.dispatcher); -- cgit