Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/cli/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,13 @@ pub struct Cmd {
pub input: InputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum InputFormat {
Single,
#[default]
SingleBase64,
}

impl Default for InputFormat {
fn default() -> Self {
Self::SingleBase64
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
18 changes: 4 additions & 14 deletions src/cli/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,26 @@ pub struct Cmd {
pub output_format: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum InputFormat {
Single,
SingleBase64,
Stream,
#[default]
StreamBase64,
StreamFramed,
}

impl Default for InputFormat {
fn default() -> Self {
Self::StreamBase64
}
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
#[default]
Json,
JsonFormatted,
Text,
RustDebug,
RustDebugFormatted,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::Json
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
18 changes: 4 additions & 14 deletions src/cli/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,22 @@ pub struct Cmd {
pub output_format: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum InputFormat {
#[default]
Json,
}

impl Default for InputFormat {
fn default() -> Self {
Self::Json
}
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
Single,
#[default]
SingleBase64,
Stream,
// TODO: StreamBase64,
// TODO: StreamFramed,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::SingleBase64
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
9 changes: 2 additions & 7 deletions src/cli/generate/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ pub struct Cmd {
pub hint_attempts: u64,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
Single,
#[default]
SingleBase64,
// TODO: Stream,
// TODO: StreamBase64,
Expand All @@ -62,12 +63,6 @@ pub enum OutputFormat {
Text,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::SingleBase64
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
9 changes: 2 additions & 7 deletions src/cli/generate/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ pub struct Cmd {
pub output_format: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
Single,
#[default]
SingleBase64,
// TODO: Stream,
// TODO: StreamBase64,
Expand All @@ -45,12 +46,6 @@ pub enum OutputFormat {
Text,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::SingleBase64
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
18 changes: 4 additions & 14 deletions src/cli/guess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,22 @@ pub struct Cmd {
pub certainty: usize,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum InputFormat {
Single,
#[default]
SingleBase64,
Stream,
StreamBase64,
StreamFramed,
}

impl Default for InputFormat {
fn default() -> Self {
Self::SingleBase64
}
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
#[default]
List,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::List
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
9 changes: 2 additions & 7 deletions src/cli/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ pub struct Cmd {
pub output: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
#[default]
Plain,
Json,
JsonFormatted,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::Plain
}
}

impl Cmd {
/// Run the CLIs types list command.
///
Expand Down
9 changes: 2 additions & 7 deletions src/cli/types/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ pub struct Cmd {
pub output: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
#[default]
JsonSchemaDraft201909,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::JsonSchemaDraft201909
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
9 changes: 2 additions & 7 deletions src/cli/types/schema_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ pub struct Cmd {
pub output: OutputFormat,
}

#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
#[derive(Default, Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]
pub enum OutputFormat {
#[default]
JsonSchemaDraft201909,
}

impl Default for OutputFormat {
fn default() -> Self {
Self::JsonSchemaDraft201909
}
}

// TODO: Remove run_x macro, it exists only to reduce the diff from when curr/next
// channels existed and each had their own run_curr/run_next invocation.
macro_rules! run_x {
Expand Down
Loading