From 586c206e50bb8e9a1376f65975f1c9916b1cde7e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 29 Mar 2026 15:00:09 +0800 Subject: Apply clippy fixes --- mingling/src/program/exec.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'mingling/src/program/exec.rs') diff --git a/mingling/src/program/exec.rs b/mingling/src/program/exec.rs index 04ed16d..ccdb17b 100644 --- a/mingling/src/program/exec.rs +++ b/mingling/src/program/exec.rs @@ -1,3 +1,5 @@ +#![allow(clippy::borrowed_box)] + use crate::{ AnyOutput, ChainProcess, Dispatcher, Program, ProgramCollect, RenderResult, error::{ChainProcessError, ProgramInternalExecuteError}, @@ -48,14 +50,13 @@ pub async fn exec( // If no renderer exists, transfer to the RendererNotFound Dispatcher for execution else { let disp: Box = Box::new(RendererNotFound); - let any = match handle_chain_process::( - disp.begin(vec![format!("{:?}", current.type_id)]), - ) { + + match handle_chain_process::(disp.begin(vec![format!("{:?}", current.type_id)])) + { Ok(Next::AnyOutput(any)) => any, Ok(Next::RenderResult(result)) => return Ok(result), Err(e) => return Err(e), - }; - any + } } }; if current.is::() || current.is::() { @@ -70,7 +71,7 @@ pub async fn exec( fn match_user_input( program: &Program, ) -> Result<(&Box, Vec), ProgramInternalExecuteError> { - let nodes = get_nodes(&program); + let nodes = get_nodes(program); let command = format!("{} ", program.args.join(" ")); // Find all nodes that match the command prefix @@ -121,11 +122,9 @@ fn handle_chain_process( Err(e) => match e { ChainProcessError::Broken(any_output) => { let render_result = render::(any_output); - return Ok(Next::RenderResult(render_result)); - } - _ => { - return Err(e.into()); + Ok(Next::RenderResult(render_result)) } + _ => Err(e.into()), }, } } -- cgit