Skip to content

Commit

Permalink
Rollup merge of rust-lang#85141 - GuillaumeGomez:maybe_collapsed_doc_…
Browse files Browse the repository at this point in the history
…value-doc, r=jsha

Update documentation for SharedContext::maybe_collapsed_doc_value

Fixes rust-lang#85120.

The `doc-collapse` was removed, however, the main crate is always "collapsed", meaning that this function is still needed. I updated the documentation instead to avoid misleading readers.

r? `@jsha`
  • Loading branch information
GuillaumeGomez committed May 12, 2021
2 parents 90f6fe8 + 0851995 commit 249ed26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl SharedContext<'_> {
Ok(())
}

/// Based on whether the `collapse-docs` pass was run, return either the `doc_value` or the
/// `collapsed_doc_value` of the given item.
/// Returns the `collapsed_doc_value` of the given item if this is the main crate, otherwise
/// returns the `doc_value`.
crate fn maybe_collapsed_doc_value<'a>(&self, item: &'a clean::Item) -> Option<String> {
if self.collapsed { item.collapsed_doc_value() } else { item.doc_value() }
}
Expand Down

0 comments on commit 249ed26

Please sign in to comment.