@@ -167,6 +167,7 @@ mod writer;
167
167
168
168
/// The quoting style to use when writing CSV data.
169
169
#[ derive( Clone , Copy , Debug ) ]
170
+ #[ non_exhaustive]
170
171
pub enum QuoteStyle {
171
172
/// This puts quotes around every field. Always.
172
173
Always ,
@@ -184,13 +185,6 @@ pub enum QuoteStyle {
184
185
NonNumeric ,
185
186
/// This *never* writes quotes, even if it would produce invalid CSV data.
186
187
Never ,
187
- /// Hints that destructuring should not be exhaustive.
188
- ///
189
- /// This enum may grow additional variants, so this makes sure clients
190
- /// don't count on exhaustive matching. (Otherwise, adding a new variant
191
- /// could break existing code.)
192
- #[ doc( hidden) ]
193
- __Nonexhaustive,
194
188
}
195
189
196
190
impl QuoteStyle {
@@ -200,7 +194,6 @@ impl QuoteStyle {
200
194
QuoteStyle :: Necessary => csv_core:: QuoteStyle :: Necessary ,
201
195
QuoteStyle :: NonNumeric => csv_core:: QuoteStyle :: NonNumeric ,
202
196
QuoteStyle :: Never => csv_core:: QuoteStyle :: Never ,
203
- _ => unreachable ! ( ) ,
204
197
}
205
198
}
206
199
}
@@ -216,18 +209,12 @@ impl Default for QuoteStyle {
216
209
/// Use this to specify the record terminator while parsing CSV. The default is
217
210
/// CRLF, which treats `\r`, `\n` or `\r\n` as a single record terminator.
218
211
#[ derive( Clone , Copy , Debug ) ]
212
+ #[ non_exhaustive]
219
213
pub enum Terminator {
220
214
/// Parses `\r`, `\n` or `\r\n` as a single record terminator.
221
215
CRLF ,
222
216
/// Parses the byte given as a record terminator.
223
217
Any ( u8 ) ,
224
- /// Hints that destructuring should not be exhaustive.
225
- ///
226
- /// This enum may grow additional variants, so this makes sure clients
227
- /// don't count on exhaustive matching. (Otherwise, adding a new variant
228
- /// could break existing code.)
229
- #[ doc( hidden) ]
230
- __Nonexhaustive,
231
218
}
232
219
233
220
impl Terminator {
@@ -236,7 +223,6 @@ impl Terminator {
236
223
match self {
237
224
Terminator :: CRLF => csv_core:: Terminator :: CRLF ,
238
225
Terminator :: Any ( b) => csv_core:: Terminator :: Any ( b) ,
239
- _ => unreachable ! ( ) ,
240
226
}
241
227
}
242
228
}
@@ -249,6 +235,7 @@ impl Default for Terminator {
249
235
250
236
/// The whitespace preservation behaviour when reading CSV data.
251
237
#[ derive( Clone , Copy , Debug , PartialEq ) ]
238
+ #[ non_exhaustive]
252
239
pub enum Trim {
253
240
/// Preserves fields and headers. This is the default.
254
241
None ,
@@ -258,13 +245,6 @@ pub enum Trim {
258
245
Fields ,
259
246
/// Trim whitespace from fields and headers.
260
247
All ,
261
- /// Hints that destructuring should not be exhaustive.
262
- ///
263
- /// This enum may grow additional variants, so this makes sure clients
264
- /// don't count on exhaustive matching. (Otherwise, adding a new variant
265
- /// could break existing code.)
266
- #[ doc( hidden) ]
267
- __Nonexhaustive,
268
248
}
269
249
270
250
impl Trim {
0 commit comments