Skip to content

Commit cceeb8f

Browse files
committed
Fix introduced error
1 parent 1448ce9 commit cceeb8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libcore/char.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,11 @@ impl Iterator for EscapeDefault {
555555
EscapeDefaultState::Unicode(ref mut i) => return iter.nth(n),
556556
};
557557

558-
let start = self.get_offset();
558+
let start = if let Some(x) = self.get_offset() {
559+
x
560+
} else {
561+
return None;
562+
};
559563
let idx = start + n;
560564

561565
// Update state

0 commit comments

Comments
 (0)