From e8e33963801b63d03a2b6d5f872348add2cecc56 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 11 Apr 2026 19:17:45 +0800 Subject: Apply clippy suggestions and remove unused serde dependency --- mingling_core/src/program/exec.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mingling_core/src/program/exec.rs') diff --git a/mingling_core/src/program/exec.rs b/mingling_core/src/program/exec.rs index 71d73e6..ff7e92b 100644 --- a/mingling_core/src/program/exec.rs +++ b/mingling_core/src/program/exec.rs @@ -21,12 +21,12 @@ where let mut stop_next = false; // Match user input - match match_user_input(&program, program.args.clone()) { + match match_user_input(program, program.args.clone()) { Ok((dispatcher, args)) => { // Entry point current = match dispatcher.begin(args) { ChainProcess::Ok((any, Next::Renderer)) => { - return Ok(render::(&program, any)); + return Ok(render::(program, any)); } ChainProcess::Ok((any, Next::Chain)) => any, ChainProcess::Err(e) => return Err(e.into()), @@ -47,7 +47,7 @@ where if C::has_chain(¤t) { match C::do_chain(current).await { ChainProcess::Ok((any, Next::Renderer)) => { - return Ok(render::(&program, any)); + return Ok(render::(program, any)); } ChainProcess::Ok((any, Next::Chain)) => any, ChainProcess::Err(e) => return Err(e.into()), @@ -55,7 +55,7 @@ where } // If no chain exists, attempt to render else if C::has_renderer(¤t) { - return Ok(render::(&program, current)); + return Ok(render::(program, current)); } // No renderer exists else { @@ -76,7 +76,7 @@ where pub fn match_user_input( program: &Program, args: Vec, -) -> Result<(&Box + Send + Sync>, Vec), ProgramInternalExecuteError> +) -> Result<(&(dyn Dispatcher + Send + Sync), Vec), ProgramInternalExecuteError> where C: ProgramCollect, G: Display, @@ -85,7 +85,7 @@ where let command = format!("{} ", args.join(" ")); // Find all nodes that match the command prefix - let matching_nodes: Vec<&(String, &Box + Send + Sync>)> = nodes + let matching_nodes: Vec<&(String, &(dyn Dispatcher + 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))) -- cgit