chore: make clippy happy

This commit is contained in:
Jonathan Kelley committed 2022-12-06 17:44:29 -08:00
1 parent 34d9aafe0e
commit 5a0ae67ccb
7 files changed
+29 -21

No files matched your search

+18 -6
View File
@@ -70,7 +70,7 @@ impl StringCache {
}
}
}
if children.len() == 0 && tag_is_self_closing(tag) {
if children.is_empty() && tag_is_self_closing(tag) {
write!(chain, "/>")?;
} else {
write!(chain, ">")?;
@@ -92,9 +92,21 @@ impl StringCache {
}
fn tag_is_self_closing(tag: &str) -> bool {
match tag {
"area" | "base" | "br" | "col" | "embed" | "hr" | "img" | "input" | "link" | "meta"
| "param" | "source" | "track" | "wbr" => true,
_ => false,
}
matches!(
tag,
"area"
| "base"
| "br"
| "col"
| "embed"
| "hr"
| "img"
| "input"
| "link"
| "meta"
| "param"
| "source"
| "track"
| "wbr"
)
}