We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
count
EscapeDefault
EscapeUnicode
1 parent c30fa92 commit baa9680Copy full SHA for baa9680
src/libcore/char.rs
@@ -470,6 +470,11 @@ impl Iterator for EscapeUnicode {
470
(n, Some(n))
471
}
472
473
+ #[inline]
474
+ fn count(self) -> usize {
475
+ self.len()
476
+ }
477
+
478
fn last(self) -> Option<char> {
479
match self.state {
480
EscapeUnicodeState::Done => None,
@@ -535,13 +540,9 @@ impl Iterator for EscapeDefault {
535
540
536
541
537
542
543
538
544
fn count(self) -> usize {
539
- match self.state {
- EscapeDefaultState::Char(_) => 1,
- EscapeDefaultState::Unicode(iter) => iter.count(),
- EscapeDefaultState::Done => 0,
- EscapeDefaultState::Backslash(_) => 2,
- }
545
546
547
548
fn nth(&mut self, n: usize) -> Option<char> {
0 commit comments