@@ -118,7 +118,7 @@ pub enum Name {
118
118
}
119
119
120
120
/// Describes whether an option has an argument.
121
- #[ deriving( Clone , PartialEq , Eq ) ]
121
+ #[ deriving( Clone , Copy , PartialEq , Eq ) ]
122
122
pub enum HasArg {
123
123
/// The option requires an argument.
124
124
Yes ,
@@ -128,10 +128,8 @@ pub enum HasArg {
128
128
Maybe ,
129
129
}
130
130
131
- impl Copy for HasArg { }
132
-
133
131
/// Describes how often an option may occur.
134
- #[ deriving( Clone , PartialEq , Eq ) ]
132
+ #[ deriving( Clone , Copy , PartialEq , Eq ) ]
135
133
pub enum Occur {
136
134
/// The option occurs once.
137
135
Req ,
@@ -141,8 +139,6 @@ pub enum Occur {
141
139
Multi ,
142
140
}
143
141
144
- impl Copy for Occur { }
145
-
146
142
/// A description of a possible option.
147
143
#[ deriving( Clone , PartialEq , Eq ) ]
148
144
pub struct Opt {
@@ -211,7 +207,7 @@ pub enum Fail {
211
207
}
212
208
213
209
/// The type of failure that occurred.
214
- #[ deriving( PartialEq , Eq ) ]
210
+ #[ deriving( Copy , PartialEq , Eq ) ]
215
211
#[ allow( missing_docs) ]
216
212
pub enum FailType {
217
213
ArgumentMissing_ ,
@@ -221,8 +217,6 @@ pub enum FailType {
221
217
UnexpectedArgument_ ,
222
218
}
223
219
224
- impl Copy for FailType { }
225
-
226
220
/// The result of parsing a command line with a set of options.
227
221
pub type Result = result:: Result < Matches , Fail > ;
228
222
@@ -839,22 +833,22 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
839
833
line
840
834
}
841
835
836
+ #[ deriving( Copy ) ]
842
837
enum SplitWithinState {
843
838
A , // leading whitespace, initial state
844
839
B , // words
845
840
C , // internal and trailing whitespace
846
841
}
847
- impl Copy for SplitWithinState { }
842
+ # [ deriving ( Copy ) ]
848
843
enum Whitespace {
849
844
Ws , // current char is whitespace
850
845
Cr // current char is not whitespace
851
846
}
852
- impl Copy for Whitespace { }
847
+ # [ deriving ( Copy ) ]
853
848
enum LengthLimit {
854
849
UnderLim , // current char makes current substring still fit in limit
855
850
OverLim // current char makes current substring no longer fit in limit
856
851
}
857
- impl Copy for LengthLimit { }
858
852
859
853
860
854
/// Splits a string into substrings with possibly internal whitespace,
0 commit comments