From a9d5943939261e27e58bcf5cacbb618a0f63e999 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 15:49:31 +0800 Subject: refactor(core): improve code style and public API clarity Replace bool-based settings with enums, refine visibility and signatures, and standardize `Self` usage across the crate. - Introduce `ErrorOutput`, `RenderOutput`, `PanicSilence`, `Verbosity`, `ColorOutput`, and `ProgressOutput` enums for clearer configuration semantics - Make `GlobalResources`, `ProgramCell`, and `split_input`/`split_input_string` public - Change hook info parameters to accept references and `split_input_string` to take `&str` - Apply `Self` shorthand throughout implementations and add `#[must_use]` attributes where appropriate - Enable strict clippy lints with targeted allowances --- mingling_core/src/program/repl_exec/splitter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mingling_core/src/program/repl_exec') diff --git a/mingling_core/src/program/repl_exec/splitter.rs b/mingling_core/src/program/repl_exec/splitter.rs index 267f42c..c74a3f1 100644 --- a/mingling_core/src/program/repl_exec/splitter.rs +++ b/mingling_core/src/program/repl_exec/splitter.rs @@ -1,14 +1,14 @@ /// Wraps `split_input` to work with owned `String` inputs. -pub(crate) fn split_input_string(input: String) -> Vec { - split_input(&input) +pub fn split_input_string(input: &str) -> Vec { + split_input(input) } /// Splits a string input into arguments, respecting single quotes, double quotes, /// and backslash escaping. -pub(crate) fn split_input(input: &str) -> Vec { +pub fn split_input(input: &str) -> Vec { let mut result: Vec = Vec::new(); let mut current = String::new(); - let mut chars = input.chars().peekable(); + let mut chars = input.chars(); while let Some(ch) = chars.next() { match ch { -- cgit