about summary refs log tree commit diff
path: root/src/libcore/char.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/char.rs')
-rw-r--r--src/libcore/char.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs
index 140403884b9..65b9a27bb68 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<char> {
+        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`.