Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 7cb38bf

Browse files
author
Hendrik van Antwerpen
committed
Don't require equals for required values, and move secondary type below type that uses it
1 parent 831f9cf commit 7cb38bf

File tree

1 file changed

+16
-17
lines changed
  • tree-sitter-stack-graphs/src/cli

1 file changed

+16
-17
lines changed

tree-sitter-stack-graphs/src/cli/test.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@ use crate::StackGraphLanguage;
3737

3838
use super::util::FileStatusLogger;
3939

40-
/// Flag to control output
41-
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
42-
pub enum OutputMode {
43-
Always,
44-
OnFailure,
45-
}
46-
47-
impl OutputMode {
48-
fn test(&self, failure: bool) -> bool {
49-
match self {
50-
Self::Always => true,
51-
Self::OnFailure => failure,
52-
}
53-
}
54-
}
55-
5640
/// Run tests
5741
#[derive(Args)]
5842
#[clap(after_help = r#"PATH SPECIFICATIONS:
@@ -143,11 +127,26 @@ pub struct TestArgs {
143127
long,
144128
arg_enum,
145129
default_value_t = OutputMode::OnFailure,
146-
require_equals = true,
147130
)]
148131
pub output_mode: OutputMode,
149132
}
150133

134+
/// Flag to control output
135+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
136+
pub enum OutputMode {
137+
Always,
138+
OnFailure,
139+
}
140+
141+
impl OutputMode {
142+
fn test(&self, failure: bool) -> bool {
143+
match self {
144+
Self::Always => true,
145+
Self::OnFailure => failure,
146+
}
147+
}
148+
}
149+
151150
impl TestArgs {
152151
pub fn new(test_paths: Vec<PathBuf>) -> Self {
153152
Self {

0 commit comments

Comments
 (0)