Skip to content

Commit c30fa92

Browse files
committed
EscapeUnicode and EscapeDefault are ExactSizeIterators
In rust-lang#28662, `size_hint` was made exact for `EscapeUnicode` and `EscapeDefault`, but neither was marked as `ExactSizeIterator`.
1 parent d5759a3 commit c30fa92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/char.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ impl Iterator for EscapeUnicode {
483483
}
484484
}
485485

486+
#[stable(feature = "exact_size_escape", since = "1.11.0")]
487+
impl ExactSizeIterator for EscapeUnicode { }
488+
486489
/// An iterator that yields the literal escape code of a `char`.
487490
///
488491
/// This `struct` is created by the [`escape_default()`] method on [`char`]. See
@@ -578,6 +581,9 @@ impl Iterator for EscapeDefault {
578581
}
579582
}
580583

584+
#[stable(feature = "exact_size_escape", since = "1.11.0")]
585+
impl ExactSizeIterator for EscapeDefault { }
586+
581587
/// An iterator over `u8` entries represending the UTF-8 encoding of a `char`
582588
/// value.
583589
///

0 commit comments

Comments
 (0)