diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-07-18 23:38:23 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-08-05 23:14:22 +0200 |
| commit | d89bf91b2d804a773f9c56cdbfcfe25cf573c848 (patch) | |
| tree | b144192cd01eb11bbcd83b72b951ec7afa05ee3a /src/librustdoc/html | |
| parent | d7270712cb446aad0817040bbca73a8d024f67b0 (diff) | |
| download | rust-d89bf91b2d804a773f9c56cdbfcfe25cf573c848.tar.gz rust-d89bf91b2d804a773f9c56cdbfcfe25cf573c848.zip | |
Display methods from DerefMut in the sidebar as well
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 2774f2b4751..ea0ebe47100 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -4579,12 +4579,13 @@ fn get_methods( i: &clean::Impl, for_deref: bool, used_links: &mut FxHashSet<String>, + deref_mut: bool, ) -> Vec<String> { i.items.iter().filter_map(|item| { match item.name { // Maybe check with clean::Visibility::Public as well? Some(ref name) if !name.is_empty() && item.visibility.is_some() && item.is_method() => { - if !for_deref || should_render_item(item, false) { + if !for_deref || should_render_item(item, deref_mut) { Some(format!("<a href=\"#{}\">{}</a>", get_next_url(used_links, format!("method.{}", name)), name)) @@ -4625,7 +4626,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String { .filter(|i| i.inner_impl().trait_.is_none()) .flat_map(move |i| get_methods(i.inner_impl(), false, - &mut used_links_bor.borrow_mut())) + &mut used_links_bor.borrow_mut(), false)) .collect::<Vec<_>>(); // We want links' order to be reproducible so we don't use unstable sort. ret.sort(); @@ -4659,7 +4660,8 @@ fn sidebar_assoc_items(it: &clean::Item) -> String { .filter(|i| i.inner_impl().trait_.is_none()) .flat_map(|i| get_methods(i.inner_impl(), true, - &mut used_links)) + &mut used_links, + true)) .collect::<Vec<_>>(); // We want links' order to be reproducible so we don't use unstable sort. ret.sort(); |
