From 240361b240d638363346013160b0943b47769c37 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 8 Apr 2026 22:48:31 +0800 Subject: Implement mingling::this function --- mingling_core/src/program/exec.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mingling_core/src/program') diff --git a/mingling_core/src/program/exec.rs b/mingling_core/src/program/exec.rs index 1a4f6ff..f578064 100644 --- a/mingling_core/src/program/exec.rs +++ b/mingling_core/src/program/exec.rs @@ -10,7 +10,9 @@ use crate::{ #[doc(hidden)] pub mod error; -pub async fn exec(program: Program) -> Result +pub async fn exec( + program: &Program, +) -> Result where C: ProgramCollect, G: Display, @@ -73,7 +75,7 @@ where #[allow(clippy::type_complexity)] fn match_user_input( program: &Program, -) -> Result<(&Box>, Vec), ProgramInternalExecuteError> +) -> Result<(&Box + Send + Sync>, Vec), ProgramInternalExecuteError> where C: ProgramCollect, G: Display, @@ -82,7 +84,7 @@ where let command = format!("{} ", program.args.join(" ")); // Find all nodes that match the command prefix - let matching_nodes: Vec<&(String, &Box>)> = nodes + let matching_nodes: Vec<&(String, &Box + Send + Sync>)> = nodes .iter() // Also add a space to the node string to ensure consistent matching logic .filter(|(node_str, _)| command.starts_with(&format!("{} ", node_str))) @@ -142,7 +144,7 @@ fn render, G: Display>( // Get all registered dispatcher names from the program fn get_nodes, G: Display>( program: &Program, -) -> Vec<(String, &Box>)> { +) -> Vec<(String, &Box + Send + Sync>)> { program .dispatcher .iter() -- cgit