Skip to content

Commit 7f5eae7

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 1027e6a commit 7f5eae7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libcore/char.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![allow(non_snake_case)]
1616
#![stable(feature = "core_char", since = "1.2.0")]
1717

18-
use iter::Iterator;
18+
use iter::{Iterator, ExactSizeIterator};
1919
use mem::transmute;
2020
use option::Option::{None, Some};
2121
use option::Option;
@@ -493,6 +493,9 @@ impl Iterator for EscapeUnicode {
493493
}
494494
}
495495

496+
#[stable(feature = "rust1", since = "1.7.0")]
497+
impl ExactSizeIterator for EscapeUnicode { }
498+
496499
/// An iterator that yields the literal escape code of a `char`.
497500
///
498501
/// This `struct` is created by the [`escape_default()`] method on [`char`]. See
@@ -587,3 +590,6 @@ impl Iterator for EscapeDefault {
587590
}
588591
}
589592
}
593+
594+
#[stable(feature = "rust1", since = "1.7.0")]
595+
impl ExactSizeIterator for EscapeDefault { }

0 commit comments

Comments
 (0)