diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-12 17:19:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-12 17:19:28 +0200 |
| commit | 249ed26b13e25e1cfef403e446303fb0679cd079 (patch) | |
| tree | 61b6da8d2994efd8a3f4daa426a0cc1abba68eb0 | |
| parent | 90f6fe852b64818cf48375cd47ddde3eafa12cfc (diff) | |
| parent | 08519959c7b1d5ffb2c0381e692f6a9198599b8a (diff) | |
| download | rust-249ed26b13e25e1cfef403e446303fb0679cd079.tar.gz rust-249ed26b13e25e1cfef403e446303fb0679cd079.zip | |
Rollup merge of #85141 - GuillaumeGomez:maybe_collapsed_doc_value-doc, r=jsha
Update documentation for SharedContext::maybe_collapsed_doc_value Fixes #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`
| -rw-r--r-- | src/librustdoc/html/render/context.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 8fd5d8b6b85..8676efd9fa8 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -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() } } |
