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<'_> {
580
580
/// if string is terminated.
581
581
fn double_quoted_string ( & mut self ) -> bool {
582
582
debug_assert ! ( self . prev( ) == '"' ) ;
583
- loop {
584
- match self . nth_char ( 0 ) {
583
+ while let Some ( c ) = self . bump ( ) {
584
+ match c {
585
585
'"' => {
586
- self . bump ( ) ;
587
586
return true ;
588
587
}
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.
591
590
self . bump ( ) ;
592
591
}
593
592
_ => ( ) ,
594
593
}
595
- self . bump ( ) ;
596
594
}
595
+ // End of file reached.
596
+ false
597
597
}
598
598
599
599
/// Eats the double-quoted string and returns a tuple of
You can’t perform that action at this time.
0 commit comments