From: Seiichi Uchida Date: Sat, 4 Aug 2018 10:27:34 +0000 (+0900) Subject: Fix parsing '#'-hiding of rustdoc X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2eca09e438c0d1471c9c602d63075d0405df8b10;p=rust.git Fix parsing '#'-hiding of rustdoc --- diff --git a/src/comment.rs b/src/comment.rs index ed83a3925b0..5958349c6ad 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -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)