@@ -419,15 +419,15 @@ fn cooked_string(input: Cursor) -> Result<Cursor, Reject> {
419419
420420fn raw_string ( input : Cursor ) -> Result < Cursor , Reject > {
421421 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) => {
426426 let rest = input. advance ( i + 1 + delimiter. len ( ) ) ;
427427 return Ok ( literal_suffix ( rest) ) ;
428428 }
429- '\r' => match chars . next ( ) {
430- Some ( ( _, '\n' ) ) => { }
429+ b '\r' => match bytes . next ( ) {
430+ Some ( ( _, b '\n') ) => { }
431431 _ => break ,
432432 } ,
433433 _ => { }
@@ -518,15 +518,15 @@ fn delimiter_of_raw_string(input: Cursor) -> PResult<&str> {
518518
519519fn raw_byte_string ( input : Cursor ) -> Result < Cursor , Reject > {
520520 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) => {
525525 let rest = input. advance ( i + 1 + delimiter. len ( ) ) ;
526526 return Ok ( literal_suffix ( rest) ) ;
527527 }
528- '\r' => match chars . next ( ) {
529- Some ( ( _, '\n' ) ) => { }
528+ b '\r' => match bytes . next ( ) {
529+ Some ( ( _, b '\n') ) => { }
530530 _ => break ,
531531 } ,
532532 other => {
0 commit comments