@@ -167,6 +167,7 @@ mod writer;
167167
168168/// The quoting style to use when writing CSV data.
169169#[ derive( Clone , Copy , Debug ) ]
170+ #[ non_exhaustive]
170171pub enum QuoteStyle {
171172 /// This puts quotes around every field. Always.
172173 Always ,
@@ -184,13 +185,6 @@ pub enum QuoteStyle {
184185 NonNumeric ,
185186 /// This *never* writes quotes, even if it would produce invalid CSV data.
186187 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,
194188}
195189
196190impl QuoteStyle {
@@ -200,7 +194,6 @@ impl QuoteStyle {
200194 QuoteStyle :: Necessary => csv_core:: QuoteStyle :: Necessary ,
201195 QuoteStyle :: NonNumeric => csv_core:: QuoteStyle :: NonNumeric ,
202196 QuoteStyle :: Never => csv_core:: QuoteStyle :: Never ,
203- _ => unreachable ! ( ) ,
204197 }
205198 }
206199}
@@ -216,18 +209,12 @@ impl Default for QuoteStyle {
216209/// Use this to specify the record terminator while parsing CSV. The default is
217210/// CRLF, which treats `\r`, `\n` or `\r\n` as a single record terminator.
218211#[ derive( Clone , Copy , Debug ) ]
212+ #[ non_exhaustive]
219213pub enum Terminator {
220214 /// Parses `\r`, `\n` or `\r\n` as a single record terminator.
221215 CRLF ,
222216 /// Parses the byte given as a record terminator.
223217 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,
231218}
232219
233220impl Terminator {
@@ -236,7 +223,6 @@ impl Terminator {
236223 match self {
237224 Terminator :: CRLF => csv_core:: Terminator :: CRLF ,
238225 Terminator :: Any ( b) => csv_core:: Terminator :: Any ( b) ,
239- _ => unreachable ! ( ) ,
240226 }
241227 }
242228}
@@ -249,6 +235,7 @@ impl Default for Terminator {
249235
250236/// The whitespace preservation behaviour when reading CSV data.
251237#[ derive( Clone , Copy , Debug , PartialEq ) ]
238+ #[ non_exhaustive]
252239pub enum Trim {
253240 /// Preserves fields and headers. This is the default.
254241 None ,
@@ -258,13 +245,6 @@ pub enum Trim {
258245 Fields ,
259246 /// Trim whitespace from fields and headers.
260247 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,
268248}
269249
270250impl Trim {
0 commit comments