aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/setups/picker/structural_renderer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src/setups/picker/structural_renderer.rs')
-rw-r--r--mingling/src/setups/picker/structural_renderer.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/mingling/src/setups/picker/structural_renderer.rs b/mingling/src/setups/picker/structural_renderer.rs
index 1fa48fd..91848e4 100644
--- a/mingling/src/setups/picker/structural_renderer.rs
+++ b/mingling/src/setups/picker/structural_renderer.rs
@@ -1,9 +1,6 @@
use mingling_core::{Program, ProgramCollect, setup::ProgramSetup};
-use crate::{
- consts::RENDERER_ARG,
- picker::{pick_global_argument, pick_global_flag},
-};
+use crate::{consts::RENDERER_ARG, picker::PickerHelper};
/// Sets up the structural renderer for the program:
///
@@ -15,7 +12,7 @@ where
C: ProgramCollect<Enum = C>,
{
fn setup(self, program: &mut Program<C>) {
- if let Some(renderer) = pick_global_argument(program, &RENDERER_ARG) {
+ if let Some(renderer) = program.pick_argument(&RENDERER_ARG) {
program.structural_renderer_name = renderer.into();
}
}
@@ -49,27 +46,27 @@ where
{
fn setup(self, program: &mut Program<C>) {
#[cfg(feature = "json_serde_fmt")]
- if pick_global_flag(program, &crate::consts::JSON_FLAG) {
+ if program.pick_flag(&crate::consts::JSON_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::Json;
}
#[cfg(feature = "json_serde_fmt")]
- if pick_global_flag(program, &crate::consts::JSON_PRETTY_FLAG) {
+ if program.pick_flag(&crate::consts::JSON_PRETTY_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::JsonPretty;
}
#[cfg(feature = "yaml_serde_fmt")]
- if pick_global_flag(program, &crate::consts::YAML_FLAG) {
+ if program.pick_flag(&crate::consts::YAML_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::Yaml;
}
#[cfg(feature = "toml_serde_fmt")]
- if pick_global_flag(program, &crate::consts::TOML_FLAG) {
+ if program.pick_flag(&crate::consts::TOML_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::Toml;
}
#[cfg(feature = "ron_serde_fmt")]
- if pick_global_flag(program, &crate::consts::RON_FLAG) {
+ if program.pick_flag(&crate::consts::RON_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::Ron;
}
#[cfg(feature = "ron_serde_fmt")]
- if pick_global_flag(program, &crate::consts::RON_PRETTY_FLAG) {
+ if program.pick_flag(&crate::consts::RON_PRETTY_FLAG) {
program.structural_renderer_name = crate::StructuralRendererSetting::RonPretty;
}
}