Skip to content

Commit 76511a7

Browse files
committed
Make 'docs' optional
1 parent a4cbb44 commit 76511a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/librustdoc/json/conversions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl JsonRenderer<'_> {
2727
name: name.map(|sym| sym.to_string()),
2828
source: self.convert_span(source),
2929
visibility: self.convert_visibility(visibility),
30-
docs: attrs.collapsed_doc_value().unwrap_or_default(),
30+
docs: attrs.collapsed_doc_value(),
3131
links: attrs
3232
.links
3333
.into_iter()

src/librustdoc/json/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct Item {
6969
/// so this field is needed to differentiate.
7070
pub visibility: Visibility,
7171
/// The full markdown docstring of this item.
72-
pub docs: String,
72+
pub docs: Option<String>,
7373
/// 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
7474
pub links: FxHashMap<String, Id>,
7575
/// Stringified versions of the attributes on this item (e.g. `"#[inline]"`)

0 commit comments

Comments
 (0)