summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-01-10 15:10:52 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-01-11 01:52:53 -0800
commit60880af47dca7f9d7aa1ccd263bb704a7b3649b6 (patch)
treeb4e8ca39e9e00df9b8f252c7616d003ad5b80ee2 /src
parent594807951f0a7761ad31642168fd3728b78923dc (diff)
downloadrust-60880af47dca7f9d7aa1ccd263bb704a7b3649b6.tar.gz
rust-60880af47dca7f9d7aa1ccd263bb704a7b3649b6.zip
rustdoc: Don't show a fields header if there are none
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 218d162de84..74f94ba00f5 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, "<h2 class='fields'>Fields</h2>\n<table>");
             for field in s.fields.iter() {
                 write!(w, "<tr><td id='structfield.{name}'>\