Skip to content

Commit aebe7a0

Browse files
committed
Eliminate unneeded peekability on cooked string iterators
1 parent e2923c3 commit aebe7a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/parse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ fn string(input: Cursor) -> Result<Cursor, Reject> {
372372
}
373373

374374
fn cooked_string(mut input: Cursor) -> Result<Cursor, Reject> {
375-
let mut chars = input.char_indices().peekable();
375+
let mut chars = input.char_indices();
376376

377377
while let Some((i, ch)) = chars.next() {
378378
match ch {
@@ -396,7 +396,7 @@ fn cooked_string(mut input: Cursor) -> Result<Cursor, Reject> {
396396
Some((newline, ch @ '\n')) | Some((newline, ch @ '\r')) => {
397397
input = input.advance(newline + 1);
398398
trailing_backslash(&mut input, ch as u8)?;
399-
chars = input.char_indices().peekable();
399+
chars = input.char_indices();
400400
}
401401
_ => break,
402402
},
@@ -540,7 +540,7 @@ fn raw_c_string(input: Cursor) -> Result<Cursor, Reject> {
540540
}
541541

542542
fn cooked_c_string(mut input: Cursor) -> Result<Cursor, Reject> {
543-
let mut chars = input.char_indices().peekable();
543+
let mut chars = input.char_indices();
544544

545545
while let Some((i, ch)) = chars.next() {
546546
match ch {
@@ -566,7 +566,7 @@ fn cooked_c_string(mut input: Cursor) -> Result<Cursor, Reject> {
566566
Some((newline, ch @ '\n')) | Some((newline, ch @ '\r')) => {
567567
input = input.advance(newline + 1);
568568
trailing_backslash(&mut input, ch as u8)?;
569-
chars = input.char_indices().peekable();
569+
chars = input.char_indices();
570570
}
571571
_ => break,
572572
},

0 commit comments

Comments
 (0)