From 7a2f0096227d773e80d1334225dc8c7e9e9cfbd0 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 22 Feb 2021 00:09:53 +1000 Subject: [PATCH] thanks clippy --- src/mimedb.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mimedb.rs b/src/mimedb.rs index abaf476..2ee86ed 100644 --- a/src/mimedb.rs +++ b/src/mimedb.rs @@ -30,8 +30,8 @@ impl MimeDb for InferDb { // and then there's some other stuff we don't care about right now // so, here comes our fancy pants """""SGML-ish validator""""" - for i in 0..buf.len() { - match buf[i] { + for c in buf { + match c { // whitespace (according to https://www.w3.org/TR/xml/#NT-S) b'\t' | b'\r' | b'\n' | b'\x20' => continue, b'<' => break, @@ -43,10 +43,10 @@ impl MimeDb for InferDb { // - split the buffer up into chunks separated by the less than sign // - check to see if this chunk starts with any of these identifiers: let identifiers: Vec<&[u8]> = vec![ - "svg".as_bytes(), - "SVG".as_bytes(), - "!DOCTYPE svg".as_bytes(), - "!DOCTYPE SVG".as_bytes() + b"svg", + b"SVG", + b"!DOCTYPE svg", + b"!DOCTYPE SVG" ]; // - if it does, the nested `any` will short circuit and immediately return true, causing the parent `any` to do // the same