From 9b4cffd48482481691f782e74a4726294043bc57 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 19 Jul 2026 00:21:23 +0800 Subject: feat(picker): extract remains constant and consolidate imports Move the inline `remains_arg` definition into a shared public constant `REMAINS` and update all consumers to import it from the new location. --- mingling/src/setups/picker/structural_renderer.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'mingling/src/setups/picker/structural_renderer.rs') diff --git a/mingling/src/setups/picker/structural_renderer.rs b/mingling/src/setups/picker/structural_renderer.rs index 69f05f1..8e5eac6 100644 --- a/mingling/src/setups/picker/structural_renderer.rs +++ b/mingling/src/setups/picker/structural_renderer.rs @@ -1,8 +1,11 @@ -use arg_picker::{IntoPicker, PickerArg, PickerArgs}; +use arg_picker::IntoPicker; use mingling_core::{Program, ProgramCollect, setup::ProgramSetup}; -use crate::setups::picker::{ - JSON_FLAG, JSON_PRETTY_FLAG, RON_FLAG, RON_PRETTY_FLAG, TOML_FLAG, YAML_FLAG, +use crate::{ + setup::picker::REMAINS, + setups::picker::{ + JSON_FLAG, JSON_PRETTY_FLAG, RON_FLAG, RON_PRETTY_FLAG, TOML_FLAG, YAML_FLAG, + }, }; /// Sets up the structural renderer for the program: @@ -47,7 +50,6 @@ fn process_renderer_flags(args: Vec, program: &mut Program) -> Vec where C: ProgramCollect, { - let remains_arg = PickerArg::::new(&[], None, true); let (json, json_pretty, yaml, toml, ron, ron_pretty, remains) = args .pick(&JSON_FLAG) .pick(&JSON_PRETTY_FLAG) @@ -55,7 +57,7 @@ where .pick(&TOML_FLAG) .pick(&RON_FLAG) .pick(&RON_PRETTY_FLAG) - .pick(&remains_arg) + .pick(&REMAINS) .unwrap(); #[cfg(feature = "json_serde_fmt")] -- cgit