@@ -419,15 +419,15 @@ fn cooked_string(input: Cursor) -> Result<Cursor, Reject> {
419
419
420
420
fn raw_string ( input : Cursor ) -> Result < Cursor , Reject > {
421
421
let ( input, delimiter) = delimiter_of_raw_string ( input) ?;
422
- let mut chars = input. char_indices ( ) ;
423
- while let Some ( ( i, ch ) ) = chars . next ( ) {
424
- match ch {
425
- '"' if input. rest [ i + 1 ..] . starts_with ( delimiter) => {
422
+ let mut bytes = input. bytes ( ) . enumerate ( ) ;
423
+ while let Some ( ( i, byte ) ) = bytes . next ( ) {
424
+ match byte {
425
+ b '"' if input. rest [ i + 1 ..] . starts_with ( delimiter) => {
426
426
let rest = input. advance ( i + 1 + delimiter. len ( ) ) ;
427
427
return Ok ( literal_suffix ( rest) ) ;
428
428
}
429
- '\r' => match chars . next ( ) {
430
- Some ( ( _, '\n' ) ) => { }
429
+ b '\r' => match bytes . next ( ) {
430
+ Some ( ( _, b '\n') ) => { }
431
431
_ => break ,
432
432
} ,
433
433
_ => { }
@@ -518,15 +518,15 @@ fn delimiter_of_raw_string(input: Cursor) -> PResult<&str> {
518
518
519
519
fn raw_byte_string ( input : Cursor ) -> Result < Cursor , Reject > {
520
520
let ( input, delimiter) = delimiter_of_raw_string ( input) ?;
521
- let mut chars = input. char_indices ( ) ;
522
- while let Some ( ( i, ch ) ) = chars . next ( ) {
523
- match ch {
524
- '"' if input. rest [ i + 1 ..] . starts_with ( delimiter) => {
521
+ let mut bytes = input. bytes ( ) . enumerate ( ) ;
522
+ while let Some ( ( i, byte ) ) = bytes . next ( ) {
523
+ match byte {
524
+ b '"' if input. rest [ i + 1 ..] . starts_with ( delimiter) => {
525
525
let rest = input. advance ( i + 1 + delimiter. len ( ) ) ;
526
526
return Ok ( literal_suffix ( rest) ) ;
527
527
}
528
- '\r' => match chars . next ( ) {
529
- Some ( ( _, '\n' ) ) => { }
528
+ b '\r' => match bytes . next ( ) {
529
+ Some ( ( _, b '\n') ) => { }
530
530
_ => break ,
531
531
} ,
532
532
other => {
0 commit comments