Skip to content

Commit

Permalink
Rollup merge of rust-lang#89444 - notriddle:notriddle/contains-str, r…
Browse files Browse the repository at this point in the history
…=jyn514

rustdoc: use slice::contains instead of open-coding it
  • Loading branch information
Manishearth authored Oct 4, 2021
2 parents 337ad5b + 277a018 commit dd925cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/passes/html_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn drop_tag(
continue;
}
let last_tag_name_low = last_tag_name.to_lowercase();
if ALLOWED_UNCLOSED.iter().any(|&at| at == last_tag_name_low) {
if ALLOWED_UNCLOSED.contains(&last_tag_name_low.as_str()) {
continue;
}
// `tags` is used as a queue, meaning that everything after `pos` is included inside it.
Expand Down Expand Up @@ -207,7 +207,7 @@ impl<'a, 'tcx> DocFolder for InvalidHtmlTagsLinter<'a, 'tcx> {

for (tag, range) in tags.iter().filter(|(t, _)| {
let t = t.to_lowercase();
ALLOWED_UNCLOSED.iter().find(|&&at| at == t).is_none()
!ALLOWED_UNCLOSED.contains(&t.as_str())
}) {
report_diag(&format!("unclosed HTML tag `{}`", tag), range);
}
Expand Down

0 comments on commit dd925cc

Please sign in to comment.