diff options
| author | Rune Tynan <runetynan@gmail.com> | 2021-01-20 15:58:03 -0500 |
|---|---|---|
| committer | Rune Tynan <runetynan@gmail.com> | 2021-01-20 15:58:03 -0500 |
| commit | 76511a7a71660b564040bfadb466251fbfa0167b (patch) | |
| tree | 03fb2a9d1106a52ad6b1ce0a9004f6ddd568e4d1 | |
| parent | a4cbb44ae2c80545db957763b502dc7f6ea22085 (diff) | |
| download | rust-76511a7a71660b564040bfadb466251fbfa0167b.tar.gz rust-76511a7a71660b564040bfadb466251fbfa0167b.zip | |
Make 'docs' optional
| -rw-r--r-- | src/librustdoc/json/conversions.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/json/types.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 7d05cb016b6..d8f1f515796 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -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() diff --git a/src/librustdoc/json/types.rs b/src/librustdoc/json/types.rs index 9335fe9be1a..2f6db0231ab 100644 --- a/src/librustdoc/json/types.rs +++ b/src/librustdoc/json/types.rs @@ -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]"`) |
