File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -580,20 +580,20 @@ impl Cursor<'_> {
580580 /// if string is terminated.
581581 fn double_quoted_string ( & mut self ) -> bool {
582582 debug_assert ! ( self . prev( ) == '"' ) ;
583- loop {
584- match self . nth_char ( 0 ) {
583+ while let Some ( c ) = self . bump ( ) {
584+ match c {
585585 '"' => {
586- self . bump ( ) ;
587586 return true ;
588587 }
589- EOF_CHAR if self . is_eof ( ) => return false ,
590- '\\' if self . nth_char ( 1 ) == '\\' || self . nth_char ( 1 ) == '"' => {
588+ '\\' if self . first ( ) == '\\' || self . first ( ) == '"' => {
589+ // Bump again to skip escaped character.
591590 self . bump ( ) ;
592591 }
593592 _ => ( ) ,
594593 }
595- self . bump ( ) ;
596594 }
595+ // End of file reached.
596+ false
597597 }
598598
599599 /// Eats the double-quoted string and returns a tuple of
You can’t perform that action at this time.
0 commit comments