Skip to content

Commit

Permalink
EscapeUnicode and EscapeDefault are ExactSizeIterators
Browse files Browse the repository at this point in the history
In rust-lang#28662, `size_hint` was made exact for `EscapeUnicode` and
`EscapeDefault`, but neither was marked as `ExactSizeIterator`.
  • Loading branch information
ranma42 committed May 26, 2016
1 parent d5759a3 commit c30fa92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit c30fa92

Please sign in to comment.