aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/setups/picker/structural_renderer.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-19 00:21:23 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-19 00:21:23 +0800
commit9b4cffd48482481691f782e74a4726294043bc57 (patch)
tree246fbac3d482e49e960e75d16dc52d1ae710d6cc /mingling/src/setups/picker/structural_renderer.rs
parent145e792e9bbda304312a9f5189bf033644e83263 (diff)
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.
Diffstat (limited to 'mingling/src/setups/picker/structural_renderer.rs')
-rw-r--r--mingling/src/setups/picker/structural_renderer.rs12
1 files changed, 7 insertions, 5 deletions
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<C>(args: Vec<String>, program: &mut Program<C>) -> Vec
where
C: ProgramCollect<Enum = C>,
{
- let remains_arg = PickerArg::<PickerArgs>::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")]