From 60880af47dca7f9d7aa1ccd263bb704a7b3649b6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Jan 2014 15:10:52 -0800 Subject: [PATCH] rustdoc: Don't show a fields header if there are none --- src/librustdoc/html/render.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 218d162de84c..74f94ba00f56 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -461,7 +461,7 @@ impl DocFolder for Cache { let orig_privmod = match item.inner { clean::ModuleItem(..) => { let prev = self.privmod; - self.privmod = prev || item.visibility != Some(ast::public); + self.privmod = prev || item.visibility != Some(ast::Public); prev } _ => self.privmod, @@ -628,7 +628,7 @@ impl DocFolder for Cache { visibility, .. } if (m.items.len() == 0 && item.doc_value().is_none()) || - visibility != Some(ast::public) => None, + visibility != Some(ast::Public) => None, i => Some(i), } @@ -1203,7 +1203,7 @@ fn item_struct(w: &mut Writer, it: &clean::Item, s: &clean::Struct) { document(w, it); match s.struct_type { - doctree::Plain => { + doctree::Plain if s.fields.len() > 0 => { write!(w, "

Fields

\n"); for field in s.fields.iter() { write!(w, "
\