@@ -81,7 +81,7 @@ pub struct Utf8String {
81
81
impl Utf8String {
82
82
pub fn new ( s : & str ) -> Self {
83
83
Utf8String {
84
- inner : s. chars ( ) . map ( |c| Utf8Char ( c ) ) . collect ( ) ,
84
+ inner : s. chars ( ) . map ( Utf8Char ) . collect ( ) ,
85
85
}
86
86
}
87
87
}
@@ -95,7 +95,7 @@ pub struct AsciiString {
95
95
impl AsciiString {
96
96
pub fn new ( s : & str ) -> Self {
97
97
AsciiString {
98
- inner : s. chars ( ) . map ( |c| AsciiChar ( c ) ) . collect ( ) ,
98
+ inner : s. chars ( ) . map ( AsciiChar ) . collect ( ) ,
99
99
}
100
100
}
101
101
}
@@ -134,29 +134,29 @@ impl<T: Bounded + Debug> Constraints<T> {
134
134
}
135
135
}
136
136
137
- pub fn min < ' a > ( & ' a mut self , min : T ) -> & ' a mut Constraints < T > {
137
+ pub fn min ( & mut self , min : T ) -> & mut Constraints < T > {
138
138
self . min = Some ( min) ;
139
139
self
140
140
}
141
141
142
- pub fn max < ' a > ( & ' a mut self , max : T ) -> & ' a mut Constraints < T > {
142
+ pub fn max ( & mut self , max : T ) -> & mut Constraints < T > {
143
143
self . max = Some ( max) ;
144
144
self
145
145
}
146
146
147
- pub fn weighted < ' a > ( & ' a mut self , weighted : Weighted ) -> & ' a mut Constraints < T > {
147
+ pub fn weighted ( & mut self , weighted : Weighted ) -> & mut Constraints < T > {
148
148
self . weighted = weighted;
149
149
self
150
150
}
151
151
152
- pub fn max_size < ' a > ( & ' a mut self , max_size : usize ) -> & ' a mut Constraints < T > {
152
+ pub fn max_size ( & mut self , max_size : usize ) -> & mut Constraints < T > {
153
153
self . max_size = Some ( max_size) ;
154
154
self
155
155
}
156
156
157
- pub fn account_for_base_object_size < ' a , U : crate :: traits:: SerializedSize > (
158
- & ' a mut self ,
159
- ) -> & ' a mut Constraints < T > {
157
+ pub fn account_for_base_object_size < U : crate :: traits:: SerializedSize > (
158
+ & mut self ,
159
+ ) -> & mut Constraints < T > {
160
160
if !self . base_object_size_accounted_for {
161
161
if let Some ( ref mut max_size) = self . max_size {
162
162
if U :: max_default_object_size ( ) > * max_size {
@@ -172,22 +172,19 @@ impl<T: Bounded + Debug> Constraints<T> {
172
172
self
173
173
}
174
174
175
- pub fn set_base_size_accounted_for < ' a > ( & ' a mut self ) -> & ' a mut Constraints < T > {
175
+ pub fn set_base_size_accounted_for ( & mut self ) -> & mut Constraints < T > {
176
176
self . base_object_size_accounted_for = true ;
177
177
self
178
178
}
179
179
}
180
180
181
181
/// Which direction to weigh ranges towards (min bound, upper bound, or none).
182
182
#[ derive( Debug , PartialEq , Clone , Copy ) ]
183
+ #[ derive( Default ) ]
183
184
pub enum Weighted {
185
+ #[ default]
184
186
None ,
185
187
Min ,
186
188
Max ,
187
189
}
188
190
189
- impl Default for Weighted {
190
- fn default ( ) -> Self {
191
- Weighted :: None
192
- }
193
- }
0 commit comments