aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program/setup
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-25 19:02:17 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-25 19:02:17 +0800
commitd4634b01e3f33b3ee52b1501f5ade739a1796d08 (patch)
tree778b229f78be7ec67367e8135d0dcc6b1fff5158 /mingling_core/src/program/setup
parent1d9a65ae06faf4a6329eb07e8c1deab3811c782b (diff)
Remove redundant generic parameter from Program struct
Diffstat (limited to 'mingling_core/src/program/setup')
-rw-r--r--mingling_core/src/program/setup/basic.rs7
-rw-r--r--mingling_core/src/program/setup/general_renderer.rs12
2 files changed, 6 insertions, 13 deletions
diff --git a/mingling_core/src/program/setup/basic.rs b/mingling_core/src/program/setup/basic.rs
index 8316a33..43c14b9 100644
--- a/mingling_core/src/program/setup/basic.rs
+++ b/mingling_core/src/program/setup/basic.rs
@@ -1,5 +1,3 @@
-use std::fmt::Display;
-
use crate::{
ProgramCollect,
program::{Program, setup::ProgramSetup},
@@ -12,12 +10,11 @@ use crate::{
/// - Collects `--confirm` flag to skip user confirmation
pub struct BasicProgramSetup;
-impl<C, G> ProgramSetup<C, G> for BasicProgramSetup
+impl<C> ProgramSetup<C> for BasicProgramSetup
where
C: ProgramCollect,
- G: Display,
{
- fn setup(&mut self, program: &mut Program<C, G>) {
+ fn setup(&mut self, program: &mut Program<C>) {
program.global_flag(["--quiet", "-q"], |p| {
p.stdout_setting.render_output = false;
p.stdout_setting.error_output = false;
diff --git a/mingling_core/src/program/setup/general_renderer.rs b/mingling_core/src/program/setup/general_renderer.rs
index 035f813..2d2ee79 100644
--- a/mingling_core/src/program/setup/general_renderer.rs
+++ b/mingling_core/src/program/setup/general_renderer.rs
@@ -1,5 +1,3 @@
-use std::fmt::Display;
-
use crate::{
ProgramCollect,
program::{Program, setup::ProgramSetup},
@@ -10,12 +8,11 @@ use crate::{
/// - Adds a `--renderer` global argument to specify the renderer type
pub struct GeneralRendererSimpleSetup;
-impl<C, G> ProgramSetup<C, G> for GeneralRendererSimpleSetup
+impl<C> ProgramSetup<C> for GeneralRendererSimpleSetup
where
C: ProgramCollect,
- G: Display,
{
- fn setup(&mut self, program: &mut Program<C, G>) {
+ fn setup(&mut self, program: &mut Program<C>) {
program.global_argument("--renderer", |p, renderer| {
p.general_renderer_name = renderer.into();
});
@@ -33,12 +30,11 @@ where
/// * `--ron-pretty` for pretty-printed RON output
pub struct GeneralRendererSetup;
-impl<C, G> ProgramSetup<C, G> for GeneralRendererSetup
+impl<C> ProgramSetup<C> for GeneralRendererSetup
where
C: ProgramCollect,
- G: Display,
{
- fn setup(&mut self, program: &mut Program<C, G>) {
+ fn setup(&mut self, program: &mut Program<C>) {
program.global_flag("--json", |p| {
p.general_renderer_name = crate::GeneralRendererSetting::Json
});