diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-10-04 13:58:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 13:58:12 -0700 |
| commit | b115a16956aa100484e5f144c2a5c72ce4dd4456 (patch) | |
| tree | 196f22ed25a21720abc3ab6932732129a7625cab | |
| parent | e1478d650d0fdecfb72a341f319efb07bb03265d (diff) | |
| parent | 277a018140f6d2a425379c6e23f346e749e4fe0c (diff) | |
Rollup merge of #89444 - notriddle:notriddle/contains-str, r=jyn514
rustdoc: use slice::contains instead of open-coding it
| -rw-r--r-- | src/librustdoc/passes/html_tags.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/passes/html_tags.rs b/src/librustdoc/passes/html_tags.rs index a0144a5298e..a3fde92d765 100644 --- a/src/librustdoc/passes/html_tags.rs +++ b/src/librustdoc/passes/html_tags.rs @@ -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. @@ -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); } |
