Skip to content

Commit 952ee8f

Browse files
committed
Simplify iteration over bytes.
1 parent db2a1a4 commit 952ee8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tokenizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ fn to_utf8(string_bytes: Vec<u8>) -> String {
854854

855855
fn consume_unquoted_url<'a>(tokenizer: &mut Tokenizer<'a>) -> Result<Token<'a>, ()> {
856856

857-
for (offset, c) in tokenizer.input[tokenizer.position..].as_bytes().iter().cloned().enumerate() {
857+
for (offset, c) in tokenizer.input[tokenizer.position..].bytes().enumerate() {
858858
match c {
859859
b' ' | b'\t' | b'\n' | b'\r' | b'\x0C' => {},
860860
b'"' | b'\'' => return Err(()), // Do not advance

0 commit comments

Comments
 (0)