diff options
| author | Rune Tynan <runetynan@gmail.com> | 2021-01-20 16:46:34 -0500 |
|---|---|---|
| committer | Rune Tynan <runetynan@gmail.com> | 2021-01-20 16:46:34 -0500 |
| commit | 450c5eae1d1cdb6a8d853ca43c848e02a9010d9b (patch) | |
| tree | 808e79abe9755e7de79600dd00f4490eae3f339d /src/librustdoc/html/render | |
| parent | a4cbb44ae2c80545db957763b502dc7f6ea22085 (diff) | |
| download | rust-450c5eae1d1cdb6a8d853ca43c848e02a9010d9b.tar.gz rust-450c5eae1d1cdb6a8d853ca43c848e02a9010d9b.zip | |
Move StructType to clean, remove it from Unions, make JSON output whether something is a union
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 03e091297e5..29ded0b854e 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -68,7 +68,6 @@ use serde::{Serialize, Serializer}; use crate::clean::{self, AttributesExt, GetDefId, RenderedLink, SelfTy, TypeKind}; use crate::config::{RenderInfo, RenderOptions}; use crate::docfs::{DocFS, PathError}; -use crate::doctree; use crate::error::Error; use crate::formats::cache::{cache, Cache}; use crate::formats::item_type::ItemType; @@ -3101,7 +3100,7 @@ fn item_struct( _ => None, }) .peekable(); - if let doctree::Plain = s.struct_type { + if let clean::StructType::Plain = s.struct_type { if fields.peek().is_some() { write!( w, @@ -3351,7 +3350,7 @@ fn render_struct( w: &mut Buffer, it: &clean::Item, g: Option<&clean::Generics>, - ty: doctree::StructType, + ty: clean::StructType, fields: &[clean::Item], tab: &str, structhead: bool, @@ -3368,7 +3367,7 @@ fn render_struct( write!(w, "{}", g.print()) } match ty { - doctree::Plain => { + clean::StructType::Plain => { if let Some(g) = g { write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: true }) } @@ -3400,7 +3399,7 @@ fn render_struct( } write!(w, "}}"); } - doctree::Tuple => { + clean::StructType::Tuple => { write!(w, "("); for (i, field) in fields.iter().enumerate() { if i > 0 { @@ -3425,7 +3424,7 @@ fn render_struct( } write!(w, ";"); } - doctree::Unit => { + clean::StructType::Unit => { // Needed for PhantomData. if let Some(g) = g { write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: false }) @@ -4460,7 +4459,7 @@ fn sidebar_struct(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, s: &clea let fields = get_struct_fields_name(&s.fields); if !fields.is_empty() { - if let doctree::Plain = s.struct_type { + if let clean::StructType::Plain = s.struct_type { sidebar.push_str(&format!( "<a class=\"sidebar-title\" href=\"#fields\">Fields</a>\ <div class=\"sidebar-links\">{}</div>", |
