From 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sun, 31 May 2026 02:42:52 +0800 Subject: Enhance code quality across the entire codebase --- mingling_core/src/program/exec/error.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'mingling_core/src/program/exec') diff --git a/mingling_core/src/program/exec/error.rs b/mingling_core/src/program/exec/error.rs index 0f2d875..944e89a 100644 --- a/mingling_core/src/program/exec/error.rs +++ b/mingling_core/src/program/exec/error.rs @@ -26,10 +26,10 @@ impl fmt::Display for ProgramExecuteError { match self { ProgramExecuteError::DispatcherNotFound => write!(f, "No Dispatcher Found"), ProgramExecuteError::RendererNotFound(s) => { - write!(f, "No Renderer (`{}`) Found", s) + write!(f, "No Renderer (`{s}`) Found") } - ProgramExecuteError::Panic(p) => write!(f, "Panic: {:?}", p), - ProgramExecuteError::Other(s) => write!(f, "Other error: {}", s), + ProgramExecuteError::Panic(p) => write!(f, "Panic: {p:?}"), + ProgramExecuteError::Other(s) => write!(f, "Other error: {s}"), } } } @@ -74,12 +74,12 @@ impl fmt::Display for ProgramInternalExecuteError { write!(f, "No Dispatcher Found") } ProgramInternalExecuteError::RendererNotFound(s) => { - write!(f, "No Renderer (`{}`) Found", s) + write!(f, "No Renderer (`{s}`) Found") } - ProgramInternalExecuteError::Other(s) => write!(f, "Other error: {}", s), - ProgramInternalExecuteError::IO(e) => write!(f, "IO error: {}", e), + ProgramInternalExecuteError::Other(s) => write!(f, "Other error: {s}"), + ProgramInternalExecuteError::IO(e) => write!(f, "IO error: {e}"), ProgramInternalExecuteError::REPLPanic(panic) => { - write!(f, "A single REPL execution failed: {}", panic) + write!(f, "A single REPL execution failed: {panic}") } } } @@ -110,11 +110,10 @@ impl From for ProgramExecuteError { ProgramExecuteError::RendererNotFound(s) } ProgramInternalExecuteError::Other(s) => ProgramExecuteError::Other(s), - ProgramInternalExecuteError::IO(e) => ProgramExecuteError::Other(format!("{}", e)), - ProgramInternalExecuteError::REPLPanic(p) => ProgramExecuteError::Other(format!( - "A single REPL execution failed: {}", - p - )), + ProgramInternalExecuteError::IO(e) => ProgramExecuteError::Other(format!("{e}")), + ProgramInternalExecuteError::REPLPanic(p) => { + ProgramExecuteError::Other(format!("A single REPL execution failed: {p}")) + } } } } -- cgit