File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -153,17 +153,11 @@ impl<'a> Cursor<'a> {
153153 }
154154 /// Eats characters until the given byte is found.
155155 /// Returns true if the byte was found, false if end of file was reached.
156- pub ( crate ) fn eat_until ( & mut self , byte : u8 ) -> bool {
157- match memchr:: memchr ( byte, self . as_str ( ) . as_bytes ( ) ) {
158- Some ( index) => {
159- self . bump_bytes ( index) ;
160- true
161- }
162- None => {
163- self . chars = "" . chars ( ) ;
164- false
165- }
166- }
156+ pub ( crate ) fn eat_until ( & mut self , byte : u8 ) {
157+ self . chars = match memchr:: memchr ( byte, self . as_str ( ) . as_bytes ( ) ) {
158+ Some ( index) => self . as_str ( ) [ index..] . chars ( ) ,
159+ None => "" . chars ( ) ,
160+ } ;
167161 }
168162
169163 /// Eats characters until any of the given bytes is found, then consumes past it.
Original file line number Diff line number Diff line change @@ -1031,7 +1031,9 @@ impl Cursor<'_> {
10311031 // Skip the string contents and on each '#' character met, check if this is
10321032 // a raw string termination.
10331033 loop {
1034- if !self . eat_until ( b'"' ) {
1034+ self . eat_until ( b'"' ) ;
1035+
1036+ if self . is_eof ( ) {
10351037 return Err ( RawStrError :: NoTerminator {
10361038 expected : n_start_hashes,
10371039 found : max_hashes,
You can’t perform that action at this time.
0 commit comments