about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-07-10 22:56:40 +0200
committerGitHub <noreply@github.com>2018-07-10 22:56:40 +0200
commitf7c2efddc78086dc81f3ff86641c63318bf072c0 (patch)
treede5c130aeaf6e73c584ebbbe926b47bb944c2288
parent115447a65dd421728d02478b9132d4a2ac3578c0 (diff)
parent26615b8f20432c2332a8ca93b18301872870dd01 (diff)
downloadrust-f7c2efddc78086dc81f3ff86641c63318bf072c0.tar.gz
rust-f7c2efddc78086dc81f3ff86641c63318bf072c0.zip
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.
-rw-r--r--src/libcore/num/flt2dec/strategy/dragon.rs4
-rw-r--r--src/libcore/num/flt2dec/strategy/grisu.rs4
-rw-r--r--src/librustdoc/html/render.rs2
-rw-r--r--src/librustdoc/html/static/main.js22
4 files changed, 18 insertions, 14 deletions
diff --git a/src/libcore/num/flt2dec/strategy/dragon.rs b/src/libcore/num/flt2dec/strategy/dragon.rs
index 6aa4f297e75..9c9e531c593 100644
--- a/src/libcore/num/flt2dec/strategy/dragon.rs
+++ b/src/libcore/num/flt2dec/strategy/dragon.rs
@@ -9,9 +9,9 @@
 // except according to those terms.
 
 /*!
-Almost direct (but slightly optimized) Rust translation of Figure 3 of [1].
+Almost direct (but slightly optimized) Rust translation of Figure 3 of \[1\].
 
-[1] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
+\[1\] Burger, R. G. and Dybvig, R. K. 1996. Printing floating-point numbers
     quickly and accurately. SIGPLAN Not. 31, 5 (May. 1996), 108-116.
 */
 
diff --git a/src/libcore/num/flt2dec/strategy/grisu.rs b/src/libcore/num/flt2dec/strategy/grisu.rs
index cf70a1978f5..5c023a191db 100644
--- a/src/libcore/num/flt2dec/strategy/grisu.rs
+++ b/src/libcore/num/flt2dec/strategy/grisu.rs
@@ -9,10 +9,10 @@
 // except according to those terms.
 
 /*!
-Rust adaptation of Grisu3 algorithm described in [1]. It uses about
+Rust adaptation of Grisu3 algorithm described in \[1\]. It uses about
 1KB of precomputed table, and in turn, it's very quick for most inputs.
 
-[1] Florian Loitsch. 2010. Printing floating-point numbers quickly and
+\[1\] Florian Loitsch. 2010. Printing floating-point numbers quickly and
     accurately with integers. SIGPLAN Not. 45, 6 (June 2010), 233-243.
 */
 
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index e4afb9ae54b..41c08dbf4ab 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1669,6 +1669,8 @@ impl<'a> Settings<'a> {
             settings: vec![
                 ("item-declarations", "Auto-hide item declarations.", true),
                 ("item-attributes", "Auto-hide item attributes.", true),
+                ("trait-implementations", "Auto-hide trait implementations documentation",
+                 true),
                 ("go-to-only-result", "Directly go to item in search if there is only one result",
                  false),
             ],
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index f3c9ce42410..3bd343c0c0b 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -1938,17 +1938,19 @@
         if (collapse) {
             toggleAllDocs(pageId, true);
         }
-        onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
-            // inherent impl ids are like 'impl' or impl-<number>'.
-            // they will never be hidden by default.
-            var n = e.parentNode;
-            if (n.id.match(/^impl(?:-\d+)?$/) === null) {
-                // Automatically minimize all non-inherent impls
-                if (collapse || hasClass(n, 'impl')) {
-                    collapseDocs(e, "hide", pageId);
+        if (getCurrentValue('rustdoc-trait-implementations') !== "false") {
+            onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
+                // inherent impl ids are like 'impl' or impl-<number>'.
+                // they will never be hidden by default.
+                var n = e.parentNode;
+                if (n.id.match(/^impl(?:-\d+)?$/) === null) {
+                    // Automatically minimize all non-inherent impls
+                    if (collapse || hasClass(n, 'impl')) {
+                        collapseDocs(e, "hide", pageId);
+                    }
                 }
-            }
-        });
+            });
+        }
     }
 
     var x = document.getElementById('toggle-all-docs');