@@ -394,6 +394,13 @@ impl Iterator for ToLowercase {
394
394
}
395
395
}
396
396
397
+ #[ stable( feature = "double_ended_case_mapping_iter" , since = "1.36.0" ) ]
398
+ impl DoubleEndedIterator for ToLowercase {
399
+ fn next_back ( & mut self ) -> Option < char > {
400
+ self . 0 . next_back ( )
401
+ }
402
+ }
403
+
397
404
#[ stable( feature = "fused" , since = "1.26.0" ) ]
398
405
impl FusedIterator for ToLowercase { }
399
406
@@ -422,6 +429,13 @@ impl Iterator for ToUppercase {
422
429
}
423
430
}
424
431
432
+ #[ stable( feature = "double_ended_case_mapping_iter" , since = "1.36.0" ) ]
433
+ impl DoubleEndedIterator for ToUppercase {
434
+ fn next_back ( & mut self ) -> Option < char > {
435
+ self . 0 . next_back ( )
436
+ }
437
+ }
438
+
425
439
#[ stable( feature = "fused" , since = "1.26.0" ) ]
426
440
impl FusedIterator for ToUppercase { }
427
441
@@ -481,6 +495,26 @@ impl Iterator for CaseMappingIter {
481
495
}
482
496
}
483
497
498
+ impl DoubleEndedIterator for CaseMappingIter {
499
+ fn next_back ( & mut self ) -> Option < char > {
500
+ match * self {
501
+ CaseMappingIter :: Three ( a, b, c) => {
502
+ * self = CaseMappingIter :: Two ( a, b) ;
503
+ Some ( c)
504
+ }
505
+ CaseMappingIter :: Two ( a, b) => {
506
+ * self = CaseMappingIter :: One ( a) ;
507
+ Some ( b)
508
+ }
509
+ CaseMappingIter :: One ( a) => {
510
+ * self = CaseMappingIter :: Zero ;
511
+ Some ( a)
512
+ }
513
+ CaseMappingIter :: Zero => None ,
514
+ }
515
+ }
516
+ }
517
+
484
518
impl fmt:: Display for CaseMappingIter {
485
519
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
486
520
match * self {
0 commit comments