diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 140403884b96d..65b9a27bb68e2 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -471,6 +471,18 @@ impl Iterator for EscapeUnicode { let n = n + self.hex_digit_idx; (n, Some(n)) } + + fn last(self) -> Option { + match self.state { + EscapeUnicodeState::Done => None, + + EscapeUnicodeState::RightBrace | + EscapeUnicodeState::Value | + EscapeUnicodeState::LeftBrace | + EscapeUnicodeState::Type | + EscapeUnicodeState::Backslash => Some('}'), + } + } } /// An iterator that yields the literal escape code of a `char`.