fix(sanitizer): 折叠嵌套 if 修复 clippy::collapsible_if
865871f 引入的 checkbox type 白名单逻辑用了嵌套 if,触发 rust 1.96 的 clippy::collapsible_if,导致 make clippy 直接失败。按 clippy 建议 合并为单个 if 链,行为不变。
This commit is contained in:
parent
59359b18ce
commit
291189fb77
@ -296,11 +296,12 @@ fn sanitize(input: &str, config: &SanitizerConfig) -> String {
|
|||||||
}
|
}
|
||||||
// input 的 type 必须是 checkbox,其余取值(image/text/...)一概删除;
|
// input 的 type 必须是 checkbox,其余取值(image/text/...)一概删除;
|
||||||
// 缺失 type 的 input 由下面的兜底逻辑整标签移除。
|
// 缺失 type 的 input 由下面的兜底逻辑整标签移除。
|
||||||
if tag == "input" && name_lower == "type" {
|
if tag == "input"
|
||||||
if attr.value().trim().to_lowercase() != "checkbox" {
|
&& name_lower == "type"
|
||||||
|
&& attr.value().trim().to_lowercase() != "checkbox"
|
||||||
|
{
|
||||||
return Some(name);
|
return Some(name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(name)
|
Some(name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user