@@ -389,11 +389,17 @@ impl Iterator for ToLowercase {
389389 fn next ( & mut self ) -> Option < char > {
390390 self . 0 . next ( )
391391 }
392+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
393+ self . 0 . size_hint ( )
394+ }
392395}
393396
394397#[ stable( feature = "fused" , since = "1.26.0" ) ]
395398impl FusedIterator for ToLowercase { }
396399
400+ #[ stable( feature = "exact_size_case_mapping_iter" , since = "1.34.0" ) ]
401+ impl ExactSizeIterator for ToLowercase { }
402+
397403/// Returns an iterator that yields the uppercase equivalent of a `char`.
398404///
399405/// This `struct` is created by the [`to_uppercase`] method on [`char`]. See
@@ -411,11 +417,17 @@ impl Iterator for ToUppercase {
411417 fn next ( & mut self ) -> Option < char > {
412418 self . 0 . next ( )
413419 }
420+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
421+ self . 0 . size_hint ( )
422+ }
414423}
415424
416425#[ stable( feature = "fused" , since = "1.26.0" ) ]
417426impl FusedIterator for ToUppercase { }
418427
428+ #[ stable( feature = "exact_size_case_mapping_iter" , since = "1.34.0" ) ]
429+ impl ExactSizeIterator for ToUppercase { }
430+
419431#[ derive( Debug , Clone ) ]
420432enum CaseMappingIter {
421433 Three ( char , char , char ) ,
@@ -457,6 +469,16 @@ impl Iterator for CaseMappingIter {
457469 CaseMappingIter :: Zero => None ,
458470 }
459471 }
472+
473+ fn size_hint ( & self ) -> ( usize , Option < usize > ) {
474+ let size = match self {
475+ CaseMappingIter :: Three ( ..) => 3 ,
476+ CaseMappingIter :: Two ( ..) => 2 ,
477+ CaseMappingIter :: One ( _) => 1 ,
478+ CaseMappingIter :: Zero => 0 ,
479+ } ;
480+ ( size, Some ( size) )
481+ }
460482}
461483
462484impl fmt:: Display for CaseMappingIter {
0 commit comments