about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-07-30 09:02:05 -0700
committerGitHub <noreply@github.com>2022-07-30 09:02:05 -0700
commitad197e414c7dee64287b7f59b7ee3567a7f05927 (patch)
treec65b396582ee7a9baeb09e4a0be8804d5464a4ea
parentf5cd6b3e9bbe1f020e1784af3227e8d5a9ca7e8f (diff)
downloadrust-ad197e414c7dee64287b7f59b7ee3567a7f05927.tar.gz
rust-ad197e414c7dee64287b7f59b7ee3567a7f05927.zip
Update src/librustdoc/passes/html_tags.rs
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
-rw-r--r--src/librustdoc/passes/html_tags.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/passes/html_tags.rs b/src/librustdoc/passes/html_tags.rs
index d65e076b818..f3a3c853cac 100644
--- a/src/librustdoc/passes/html_tags.rs
+++ b/src/librustdoc/passes/html_tags.rs
@@ -99,7 +99,7 @@ fn is_valid_for_html_tag_name(c: char, is_empty: bool) -> bool {
     //
     // > A tag name consists of an ASCII letter followed by zero or more ASCII letters, digits, or
     // > hyphens (-).
-    c.is_ascii_alphabetic() || (c.is_ascii_digit() && !is_empty) || (c == '-' && !is_empty)
+    c.is_ascii_alphabetic() || !is_empty && (c == '-' || c.is_ascii_digit())
 }
 
 fn extract_html_tag(