diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-11 19:17:45 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-11 19:17:45 +0800 |
| commit | e8e33963801b63d03a2b6d5f872348add2cecc56 (patch) | |
| tree | 87e2396356f060e9211829bcbe4f4c64b6e8d5ea /mingling_core/src/program/exec.rs | |
| parent | 3a366931579cbda5fef32f1ae9d2ea09377c60af (diff) | |
Apply clippy suggestions and remove unused serde dependency
Diffstat (limited to 'mingling_core/src/program/exec.rs')
| -rw-r--r-- | mingling_core/src/program/exec.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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::<C, G>(&program, any)); + return Ok(render::<C, G>(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::<C, G>(&program, any)); + return Ok(render::<C, G>(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::<C, G>(&program, current)); + return Ok(render::<C, G>(program, current)); } // No renderer exists else { @@ -76,7 +76,7 @@ where pub fn match_user_input<C, G>( program: &Program<C, G>, args: Vec<String>, -) -> Result<(&Box<dyn Dispatcher<G> + Send + Sync>, Vec<String>), ProgramInternalExecuteError> +) -> Result<(&(dyn Dispatcher<G> + Send + Sync), Vec<String>), ProgramInternalExecuteError> where C: ProgramCollect<Enum = G>, 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<dyn Dispatcher<G> + Send + Sync>)> = nodes + let matching_nodes: Vec<&(String, &(dyn Dispatcher<G> + 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))) |
