File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -240,14 +240,15 @@ impl<'a> Codegen<'a> {
240240 let mut consumed = 0 ;
241241 let mut i = 0 ;
242242
243- // Only check when remaining string has length larger than 8.
243+ // Only check when remaining string has length larger than 8
244244 while i + 8 <= slice. len ( ) {
245245 if is_script_close_tag ( & slice[ i..i + 8 ] ) {
246246 // Push str up to and including `<`. Skip `/`. Write `\/` instead.
247+ // Skip over `script` - it'll be written in next chunk.
247248 // SAFETY:
248- // The slice guarantees to be a valid UTF-8 string.
249- // The consumed index is always pointed to a UTF-8 char boundary.
250- // Current byte is `<`, a UTF-8 char boundary.
249+ // The slice is guaranteed to be a valid UTF-8 string.
250+ // ` consumed` is always on a UTF-8 char boundary.
251+ // `i` is on `<`, so `i + 1` is a UTF-8 char boundary.
251252 unsafe {
252253 self . code . print_bytes_unchecked ( & slice[ consumed..=i] ) ;
253254 }
You can’t perform that action at this time.
0 commit comments