]> git.lizzy.rs Git - rust.git/commitdiff
Fix parsing '#'-hiding of rustdoc
authorSeiichi Uchida <seuchida@gmail.com>
Sat, 4 Aug 2018 10:27:34 +0000 (19:27 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Sat, 4 Aug 2018 23:44:20 +0000 (08:44 +0900)
src/comment.rs

index ed83a3925b005ebe30fe35b24db76651fce81ab7..5958349c6ad6869fb32a4e7f4f3a5160395907ea 100644 (file)
@@ -500,7 +500,7 @@ fn rewrite_comment_inner(
 const RUSTFMT_CUSTOM_COMMENT_PREFIX: &str = "//#### ";
 
 fn hide_sharp_behind_comment<'a>(s: &'a str) -> Cow<'a, str> {
-    if s.trim_left().starts_with('#') {
+    if s.trim_left().starts_with("# ") {
         Cow::from(format!("{}{}", RUSTFMT_CUSTOM_COMMENT_PREFIX, s))
     } else {
         Cow::from(s)