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 Jan 20, 2016
1 parent 1027e6a commit 7f5eae7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#![allow(non_snake_case)]
#![stable(feature = "core_char", since = "1.2.0")]

use iter::Iterator;
use iter::{Iterator, ExactSizeIterator};
use mem::transmute;
use option::Option::{None, Some};
use option::Option;
Expand Down Expand Up @@ -493,6 +493,9 @@ impl Iterator for EscapeUnicode {
}
}

#[stable(feature = "rust1", since = "1.7.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 @@ -587,3 +590,6 @@ impl Iterator for EscapeDefault {
}
}
}

#[stable(feature = "rust1", since = "1.7.0")]
impl ExactSizeIterator for EscapeDefault { }

0 comments on commit 7f5eae7

Please sign in to comment.