thanks clippy

This commit is contained in:
Lynne Megido 2021-02-22 00:09:53 +10:00
parent 986717a6ae
commit 7a2f009622
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -30,8 +30,8 @@ impl MimeDb for InferDb {
// and then there's some other stuff we don't care about right now // and then there's some other stuff we don't care about right now
// so, here comes our fancy pants """""SGML-ish validator""""" // so, here comes our fancy pants """""SGML-ish validator"""""
for i in 0..buf.len() { for c in buf {
match buf[i] { match c {
// whitespace (according to https://www.w3.org/TR/xml/#NT-S) // whitespace (according to https://www.w3.org/TR/xml/#NT-S)
b'\t' | b'\r' | b'\n' | b'\x20' => continue, b'\t' | b'\r' | b'\n' | b'\x20' => continue,
b'<' => break, b'<' => break,
@ -43,10 +43,10 @@ impl MimeDb for InferDb {
// - split the buffer up into chunks separated by the less than sign // - split the buffer up into chunks separated by the less than sign
// - check to see if this chunk starts with any of these identifiers: // - check to see if this chunk starts with any of these identifiers:
let identifiers: Vec<&[u8]> = vec![ let identifiers: Vec<&[u8]> = vec![
"svg".as_bytes(), b"svg",
"SVG".as_bytes(), b"SVG",
"!DOCTYPE svg".as_bytes(), b"!DOCTYPE svg",
"!DOCTYPE SVG".as_bytes() b"!DOCTYPE SVG"
]; ];
// - if it does, the nested `any` will short circuit and immediately return true, causing the parent `any` to do // - if it does, the nested `any` will short circuit and immediately return true, causing the parent `any` to do
// the same // the same