libgetopts: use #[deriving(Copy)]
This commit is contained in:
parent
4c62c76ef9
commit
c407785ac0
1 changed files with 6 additions and 12 deletions
|
|
@ -118,7 +118,7 @@ pub enum Name {
|
|||
}
|
||||
|
||||
/// Describes whether an option has an argument.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum HasArg {
|
||||
/// The option requires an argument.
|
||||
Yes,
|
||||
|
|
@ -128,10 +128,8 @@ pub enum HasArg {
|
|||
Maybe,
|
||||
}
|
||||
|
||||
impl Copy for HasArg {}
|
||||
|
||||
/// Describes how often an option may occur.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
#[deriving(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Occur {
|
||||
/// The option occurs once.
|
||||
Req,
|
||||
|
|
@ -141,8 +139,6 @@ pub enum Occur {
|
|||
Multi,
|
||||
}
|
||||
|
||||
impl Copy for Occur {}
|
||||
|
||||
/// A description of a possible option.
|
||||
#[deriving(Clone, PartialEq, Eq)]
|
||||
pub struct Opt {
|
||||
|
|
@ -211,7 +207,7 @@ pub enum Fail {
|
|||
}
|
||||
|
||||
/// The type of failure that occurred.
|
||||
#[deriving(PartialEq, Eq)]
|
||||
#[deriving(Copy, PartialEq, Eq)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum FailType {
|
||||
ArgumentMissing_,
|
||||
|
|
@ -221,8 +217,6 @@ pub enum FailType {
|
|||
UnexpectedArgument_,
|
||||
}
|
||||
|
||||
impl Copy for FailType {}
|
||||
|
||||
/// The result of parsing a command line with a set of options.
|
||||
pub type Result = result::Result<Matches, Fail>;
|
||||
|
||||
|
|
@ -839,22 +833,22 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
|
|||
line
|
||||
}
|
||||
|
||||
#[deriving(Copy)]
|
||||
enum SplitWithinState {
|
||||
A, // leading whitespace, initial state
|
||||
B, // words
|
||||
C, // internal and trailing whitespace
|
||||
}
|
||||
impl Copy for SplitWithinState {}
|
||||
#[deriving(Copy)]
|
||||
enum Whitespace {
|
||||
Ws, // current char is whitespace
|
||||
Cr // current char is not whitespace
|
||||
}
|
||||
impl Copy for Whitespace {}
|
||||
#[deriving(Copy)]
|
||||
enum LengthLimit {
|
||||
UnderLim, // current char makes current substring still fit in limit
|
||||
OverLim // current char makes current substring no longer fit in limit
|
||||
}
|
||||
impl Copy for LengthLimit {}
|
||||
|
||||
|
||||
/// Splits a string into substrings with possibly internal whitespace,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue