Make 'docs' optional

This commit is contained in:
Rune Tynan 2021-01-20 15:58:03 -05:00
parent a4cbb44ae2
commit 76511a7a71
No known key found for this signature in database
GPG Key ID: 7ECC932F8B2C731E
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ impl JsonRenderer<'_> {
name: name.map(|sym| sym.to_string()),
source: self.convert_span(source),
visibility: self.convert_visibility(visibility),
docs: attrs.collapsed_doc_value().unwrap_or_default(),
docs: attrs.collapsed_doc_value(),
links: attrs
.links
.into_iter()

View File

@ -69,7 +69,7 @@ pub struct Item {
/// so this field is needed to differentiate.
pub visibility: Visibility,
/// The full markdown docstring of this item.
pub docs: String,
pub docs: Option<String>,
/// This mapping resolves [intra-doc links](https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) from the docstring to their IDs
pub links: FxHashMap<String, Id>,
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)