@@ -35,7 +35,7 @@ use std::string;
35
35
36
36
/// A piece is a portion of the format string which represents the next part
37
37
/// to emit. These are emitted as a stream by the `Parser` class.
38
- #[ deriving( PartialEq ) ]
38
+ #[ deriving( Copy , PartialEq ) ]
39
39
pub enum Piece < ' a > {
40
40
/// A literal string which should directly be emitted
41
41
String ( & ' a str ) ,
@@ -44,21 +44,17 @@ pub enum Piece<'a> {
44
44
NextArgument ( Argument < ' a > ) ,
45
45
}
46
46
47
- impl < ' a > Copy for Piece < ' a > { }
48
-
49
47
/// Representation of an argument specification.
50
- #[ deriving( PartialEq ) ]
48
+ #[ deriving( Copy , PartialEq ) ]
51
49
pub struct Argument < ' a > {
52
50
/// Where to find this argument
53
51
pub position : Position < ' a > ,
54
52
/// How to format the argument
55
53
pub format : FormatSpec < ' a > ,
56
54
}
57
55
58
- impl < ' a > Copy for Argument < ' a > { }
59
-
60
56
/// Specification for the formatting of an argument in the format string.
61
- #[ deriving( PartialEq ) ]
57
+ #[ deriving( Copy , PartialEq ) ]
62
58
pub struct FormatSpec < ' a > {
63
59
/// Optionally specified character to fill alignment with
64
60
pub fill : Option < char > ,
@@ -76,10 +72,8 @@ pub struct FormatSpec<'a> {
76
72
pub ty : & ' a str
77
73
}
78
74
79
- impl < ' a > Copy for FormatSpec < ' a > { }
80
-
81
75
/// Enum describing where an argument for a format can be located.
82
- #[ deriving( PartialEq ) ]
76
+ #[ deriving( Copy , PartialEq ) ]
83
77
pub enum Position < ' a > {
84
78
/// The argument will be in the next position. This is the default.
85
79
ArgumentNext ,
@@ -89,10 +83,8 @@ pub enum Position<'a> {
89
83
ArgumentNamed ( & ' a str ) ,
90
84
}
91
85
92
- impl < ' a > Copy for Position < ' a > { }
93
-
94
86
/// Enum of alignments which are supported.
95
- #[ deriving( PartialEq ) ]
87
+ #[ deriving( Copy , PartialEq ) ]
96
88
pub enum Alignment {
97
89
/// The value will be aligned to the left.
98
90
AlignLeft ,
@@ -104,11 +96,9 @@ pub enum Alignment {
104
96
AlignUnknown ,
105
97
}
106
98
107
- impl Copy for Alignment { }
108
-
109
99
/// Various flags which can be applied to format strings. The meaning of these
110
100
/// flags is defined by the formatters themselves.
111
- #[ deriving( PartialEq ) ]
101
+ #[ deriving( Copy , PartialEq ) ]
112
102
pub enum Flag {
113
103
/// A `+` will be used to denote positive numbers.
114
104
FlagSignPlus ,
@@ -122,11 +112,9 @@ pub enum Flag {
122
112
FlagSignAwareZeroPad ,
123
113
}
124
114
125
- impl Copy for Flag { }
126
-
127
115
/// A count is used for the precision and width parameters of an integer, and
128
116
/// can reference either an argument or a literal integer.
129
- #[ deriving( PartialEq ) ]
117
+ #[ deriving( Copy , PartialEq ) ]
130
118
pub enum Count < ' a > {
131
119
/// The count is specified explicitly.
132
120
CountIs ( uint ) ,
@@ -140,8 +128,6 @@ pub enum Count<'a> {
140
128
CountImplied ,
141
129
}
142
130
143
- impl < ' a > Copy for Count < ' a > { }
144
-
145
131
/// The parser structure for interpreting the input format string. This is
146
132
/// modelled as an iterator over `Piece` structures to form a stream of tokens
147
133
/// being output.
0 commit comments