]> git.lizzy.rs Git - rust.git/commitdiff
Don't generate doc if doc comments only filled with 'white' characters
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 27 Jan 2017 15:59:35 +0000 (16:59 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 27 Jan 2017 22:18:07 +0000 (23:18 +0100)
src/librustdoc/html/markdown.rs

index f2427008a7d45f830d9b8ac838740fae8633dcc9..8cc3b60a184064fba089f287f75d9955f05fa284 100644 (file)
@@ -237,8 +237,9 @@ pub fn render(w: &mut fmt::Formatter,
             let my_opaque: &MyOpaque = &*((*opaque).opaque as *const MyOpaque);
             let text = (*orig_text).as_bytes();
             let origtext = str::from_utf8(text).unwrap();
+            let origtext = origtext.trim_left();
             debug!("docblock: ==============\n{:?}\n=======", text);
-            let rendered = if lang.is_null() {
+            let rendered = if lang.is_null() || origtext.is_empty() {
                 false
             } else {
                 let rlang = (*lang).as_bytes();