1
Fork 0

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()), name: name.map(|sym| sym.to_string()),
source: self.convert_span(source), source: self.convert_span(source),
visibility: self.convert_visibility(visibility), visibility: self.convert_visibility(visibility),
docs: attrs.collapsed_doc_value().unwrap_or_default(), docs: attrs.collapsed_doc_value(),
links: attrs links: attrs
.links .links
.into_iter() .into_iter()

View file

@ -69,7 +69,7 @@ pub struct Item {
/// so this field is needed to differentiate. /// so this field is needed to differentiate.
pub visibility: Visibility, pub visibility: Visibility,
/// The full markdown docstring of this item. /// 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 /// 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>, pub links: FxHashMap<String, Id>,
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`) /// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)