From c30fa92a0aac87ba27df261ece44602f027a1800 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Wed, 30 Dec 2015 10:08:28 +0100 Subject: [PATCH] `EscapeUnicode` and `EscapeDefault` are `ExactSizeIterator`s In #28662, `size_hint` was made exact for `EscapeUnicode` and `EscapeDefault`, but neither was marked as `ExactSizeIterator`. --- src/libcore/char.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 6a2331dddcf0e..25d90cc6f3a4a 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -483,6 +483,9 @@ impl Iterator for EscapeUnicode { } } +#[stable(feature = "exact_size_escape", since = "1.11.0")] +impl ExactSizeIterator for EscapeUnicode { } + /// An iterator that yields the literal escape code of a `char`. /// /// This `struct` is created by the [`escape_default()`] method on [`char`]. See @@ -578,6 +581,9 @@ impl Iterator for EscapeDefault { } } +#[stable(feature = "exact_size_escape", since = "1.11.0")] +impl ExactSizeIterator for EscapeDefault { } + /// An iterator over `u8` entries represending the UTF-8 encoding of a `char` /// value. ///