Skip to content

Commit

Permalink
Merge pull request #2266 from budde25/traits
Browse files Browse the repository at this point in the history
imp: added more common derives App, Arg, and ArgMatches
  • Loading branch information
pksunkara authored Dec 26, 2020
2 parents db3f10c + c26d1a4 commit 7728000
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/build/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use crate::{
/// // Your program logic starts here...
/// ```
/// [`App::get_matches`]: ./struct.App.html#method.get_matches
#[derive(Default, Debug, Clone)]
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct App<'help> {
pub(crate) id: Id,
pub(crate) name: String,
Expand Down
2 changes: 1 addition & 1 deletion src/build/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bitflags! {
}
}

#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub(crate) struct AppFlags(Flags);

impl BitOr for AppFlags {
Expand Down
2 changes: 1 addition & 1 deletion src/build/arg_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use yaml_rust::Yaml;
/// [arguments]: ./struct.Arg.html
/// [conflict]: ./struct.Arg.html#method.conflicts_with
/// [requirement]: ./struct.Arg.html#method.requires
#[derive(Default, Debug)]
#[derive(Default, Debug, PartialEq, Eq)]
pub struct ArgGroup<'help> {
pub(crate) id: Id,
pub(crate) name: &'help str,
Expand Down
4 changes: 2 additions & 2 deletions src/mkeymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use std::{
ops::Index,
};

#[derive(PartialEq, Debug, Clone)]
#[derive(PartialEq, Eq, Debug, Clone)]
pub(crate) struct Key {
pub(crate) key: KeyType,
pub(crate) index: usize,
}

#[derive(Default, PartialEq, Debug, Clone)]
#[derive(Default, PartialEq, Eq, Debug, Clone)]
pub(crate) struct MKeyMap<'help> {
pub(crate) keys: Vec<Key>,
pub(crate) args: Vec<Arg<'help>>,
Expand Down
4 changes: 2 additions & 2 deletions src/parse/matches/arg_matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
{Error, INVALID_UTF8},
};

#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct SubCommand {
pub(crate) id: Id,
pub(crate) name: String,
Expand Down Expand Up @@ -72,7 +72,7 @@ pub(crate) struct SubCommand {
/// }
/// ```
/// [`App::get_matches`]: ./struct.App.html#method.get_matches
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ArgMatches {
pub(crate) args: IndexMap<Id, MatchedArg>,
pub(crate) subcommand: Option<Box<SubCommand>>,
Expand Down
2 changes: 1 addition & 1 deletion src/parse/matches/matched_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) enum ValueType {
DefaultValue,
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct MatchedArg {
pub(crate) occurs: u64,
pub(crate) ty: ValueType,
Expand Down

0 comments on commit 7728000

Please sign in to comment.