Skip to content

Commit f7c2efd

Browse files
Rollup merge of #52151 - GuillaumeGomez:trait-impl-settings, r=QuietMisdreavus
Trait impl settings Fixes #51797. r? @QuietMisdreavus PS: I was annoyed by some intra link failures so I fixed them as well.
2 parents 115447a + 26615b8 commit f7c2efd

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

src/libcore/num/flt2dec/strategy/dragon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
/*!
12-
Almost direct (but slightly optimized) Rust translation of Figure 3 of [1].
12+
Almost direct (but slightly optimized) Rust translation of Figure 3 of \[1\].
1313
14-
[1] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
14+
\[1\] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
1515
quickly and accurately. SIGPLAN Not. 31, 5 (May. 1996), 108-116.
1616
*/
1717

src/libcore/num/flt2dec/strategy/grisu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
// except according to those terms.
1010

1111
/*!
12-
Rust adaptation of Grisu3 algorithm described in [1]. It uses about
12+
Rust adaptation of Grisu3 algorithm described in \[1\]. It uses about
1313
1KB of precomputed table, and in turn, it's very quick for most inputs.
1414
15-
[1] Florian Loitsch. 2010. Printing floating-point numbers quickly and
15+
\[1\] Florian Loitsch. 2010. Printing floating-point numbers quickly and
1616
accurately with integers. SIGPLAN Not. 45, 6 (June 2010), 233-243.
1717
*/
1818

src/librustdoc/html/render.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,8 @@ impl<'a> Settings<'a> {
16691669
settings: vec![
16701670
("item-declarations", "Auto-hide item declarations.", true),
16711671
("item-attributes", "Auto-hide item attributes.", true),
1672+
("trait-implementations", "Auto-hide trait implementations documentation",
1673+
true),
16721674
("go-to-only-result", "Directly go to item in search if there is only one result",
16731675
false),
16741676
],

src/librustdoc/html/static/main.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,17 +1938,19 @@
19381938
if (collapse) {
19391939
toggleAllDocs(pageId, true);
19401940
}
1941-
onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
1942-
// inherent impl ids are like 'impl' or impl-<number>'.
1943-
// they will never be hidden by default.
1944-
var n = e.parentNode;
1945-
if (n.id.match(/^impl(?:-\d+)?$/) === null) {
1946-
// Automatically minimize all non-inherent impls
1947-
if (collapse || hasClass(n, 'impl')) {
1948-
collapseDocs(e, "hide", pageId);
1941+
if (getCurrentValue('rustdoc-trait-implementations') !== "false") {
1942+
onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
1943+
// inherent impl ids are like 'impl' or impl-<number>'.
1944+
// they will never be hidden by default.
1945+
var n = e.parentNode;
1946+
if (n.id.match(/^impl(?:-\d+)?$/) === null) {
1947+
// Automatically minimize all non-inherent impls
1948+
if (collapse || hasClass(n, 'impl')) {
1949+
collapseDocs(e, "hide", pageId);
1950+
}
19491951
}
1950-
}
1951-
});
1952+
});
1953+
}
19521954
}
19531955

19541956
var x = document.getElementById('toggle-all-docs');

0 commit comments

Comments
 (0)