Skip to content

Commit 277a018

Browse files
committed
rustdoc: use slice::contains instead of open-coding it
1 parent ed93759 commit 277a018

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/passes/html_tags.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn drop_tag(
5252
continue;
5353
}
5454
let last_tag_name_low = last_tag_name.to_lowercase();
55-
if ALLOWED_UNCLOSED.iter().any(|&at| at == last_tag_name_low) {
55+
if ALLOWED_UNCLOSED.contains(&last_tag_name_low.as_str()) {
5656
continue;
5757
}
5858
// `tags` is used as a queue, meaning that everything after `pos` is included inside it.
@@ -207,7 +207,7 @@ impl<'a, 'tcx> DocFolder for InvalidHtmlTagsLinter<'a, 'tcx> {
207207

208208
for (tag, range) in tags.iter().filter(|(t, _)| {
209209
let t = t.to_lowercase();
210-
ALLOWED_UNCLOSED.iter().find(|&&at| at == t).is_none()
210+
!ALLOWED_UNCLOSED.contains(&t.as_str())
211211
}) {
212212
report_diag(&format!("unclosed HTML tag `{}`", tag), range);
213213
}

0 commit comments

Comments
 (0)