@@ -225,20 +225,6 @@ pub enum CaseLevel {
225
225
On = 1 ,
226
226
}
227
227
228
- /// Whether second level compares the last accent difference
229
- /// instead of the first accent difference.
230
- #[ derive( Eq , PartialEq , Debug , Copy , Clone ) ]
231
- #[ repr( u8 ) ]
232
- #[ non_exhaustive]
233
- pub enum BackwardSecondLevel {
234
- /// Leave off the backward second level option. Diacritics in the second level will be ordered by
235
- /// default from beginning to end.
236
- Off = 0 ,
237
- /// Turn on backward second level ordering so that the second level compares backwards, starting
238
- /// from the last diacritic letter and moving towards the beginning.
239
- On = 1 ,
240
- }
241
-
242
228
/// Options settable by the user of the API.
243
229
///
244
230
/// With the exception of reordering (BCP47 `kr`), options that can by implied by locale are
@@ -283,17 +269,15 @@ pub enum BackwardSecondLevel {
283
269
/// See the [spec](https://www.unicode.org/reports/tr35/tr35-collation.html#Case_Parameters).
284
270
/// This is the BCP47 key `kc`. The default is [`CaseLevel::Off`].
285
271
///
286
- /// ## Backward second level
287
- ///
288
- /// Compare the second level in backward order. This is the BCP47 key `kb`. `kb`
289
- /// is prohibited by ECMA-402. The default is [`BackwardSecondLevel::Off`], except
290
- /// for Canadian French.
291
- ///
292
272
/// # Unsupported BCP47 options
293
273
///
294
274
/// Reordering (BCP47 `kr`) currently cannot be set via the API and is implied
295
275
/// by the locale of the collation. `kr` is prohibited by ECMA-402.
296
276
///
277
+ /// Backward second level (BCP47 `kb`) cannot be set via the API and is implied
278
+ /// by the locale of the collation (in practice only `fr-CA` turns it on and it's
279
+ /// off otherwise). `kb` is prohibited by ECMA-402.
280
+ ///
297
281
/// Normalization is always enabled and cannot be turned off. Therefore, there
298
282
/// is no option corresponding to BCP47 `kk`. `kk` is prohibited by ECMA-402.
299
283
///
@@ -330,8 +314,6 @@ pub struct CollatorOptions {
330
314
pub max_variable : Option < MaxVariable > ,
331
315
/// User-specified case level collation option.
332
316
pub case_level : Option < CaseLevel > ,
333
- /// User-specified backward second level collation option.
334
- pub backward_second_level : Option < BackwardSecondLevel > ,
335
317
}
336
318
337
319
impl CollatorOptions {
@@ -342,7 +324,6 @@ impl CollatorOptions {
342
324
alternate_handling : None ,
343
325
max_variable : None ,
344
326
case_level : None ,
345
- backward_second_level : None ,
346
327
}
347
328
}
348
329
}
@@ -359,7 +340,6 @@ impl From<ResolvedCollatorOptions> for CollatorOptions {
359
340
alternate_handling : Some ( options. alternate_handling ) ,
360
341
max_variable : Some ( options. max_variable ) ,
361
342
case_level : Some ( options. case_level ) ,
362
- backward_second_level : Some ( options. backward_second_level ) ,
363
343
}
364
344
}
365
345
}
@@ -403,8 +383,6 @@ pub struct ResolvedCollatorOptions {
403
383
pub case_level : CaseLevel ,
404
384
/// Resolved numeric collation option.
405
385
pub numeric : CollationNumericOrdering ,
406
- /// Resolved backward second level collation option.
407
- pub backward_second_level : BackwardSecondLevel ,
408
386
}
409
387
410
388
impl From < CollatorOptionsBitField > for ResolvedCollatorOptions {
@@ -424,11 +402,7 @@ impl From<CollatorOptionsBitField> for ResolvedCollatorOptions {
424
402
} else {
425
403
CollationNumericOrdering :: False
426
404
} ,
427
- backward_second_level : if options. backward_second_level ( ) {
428
- BackwardSecondLevel :: On
429
- } else {
430
- BackwardSecondLevel :: Off
431
- } ,
405
+ // `options.backward_second_level()` not exposed.
432
406
}
433
407
}
434
408
}
@@ -660,21 +634,6 @@ impl CollatorOptionsBitField {
660
634
}
661
635
}
662
636
663
- pub fn set_backward_second_level_from_enum (
664
- & mut self ,
665
- backward_second_level : Option < BackwardSecondLevel > ,
666
- ) {
667
- match backward_second_level {
668
- Some ( BackwardSecondLevel :: On ) => {
669
- self . set_backward_second_level ( Some ( true ) ) ;
670
- }
671
- Some ( BackwardSecondLevel :: Off ) => {
672
- self . set_backward_second_level ( Some ( false ) ) ;
673
- }
674
- None => self . set_backward_second_level ( None ) ,
675
- }
676
- }
677
-
678
637
/// Whether sequences of decimal digits are compared according
679
638
/// to their numeric value.
680
639
pub fn numeric ( self ) -> bool {
@@ -784,7 +743,6 @@ impl From<CollatorOptions> for CollatorOptionsBitField {
784
743
result. set_max_variable ( options. max_variable ) ;
785
744
result. set_alternate_handling ( options. alternate_handling ) ;
786
745
result. set_case_level_from_enum ( options. case_level ) ;
787
- result. set_backward_second_level_from_enum ( options. backward_second_level ) ;
788
746
result
789
747
}
790
748
}
0 commit comments