about summary refs log tree commit diff
path: root/src/librustdoc/html/toc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/toc.rs')
-rw-r--r--src/librustdoc/html/toc.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/html/toc.rs b/src/librustdoc/html/toc.rs
index 034fb273000..721988e29a6 100644
--- a/src/librustdoc/html/toc.rs
+++ b/src/librustdoc/html/toc.rs
@@ -5,7 +5,7 @@
 pub struct Toc {
     /// The levels are strictly decreasing, i.e.
     ///
-    /// entries[0].level >= entries[1].level >= ...
+    /// `entries[0].level >= entries[1].level >= ...`
     ///
     /// Normally they are equal, but can differ in cases like A and B,
     /// both of which end up in the same `Toc` as they have the same
@@ -39,8 +39,8 @@ pub struct TocEntry {
 pub struct TocBuilder {
     top_level: Toc,
     /// The current hierarchy of parent headings, the levels are
-    /// strictly increasing (i.e., chain[0].level < chain[1].level <
-    /// ...) with each entry being the most recent occurrence of a
+    /// strictly increasing (i.e., `chain[0].level < chain[1].level <
+    /// ...`) with each entry being the most recent occurrence of a
     /// heading with that level (it doesn't include the most recent
     /// occurrences of every level, just, if it *is* in `chain` then
     /// it is the most recent one).
@@ -94,7 +94,7 @@ impl TocBuilder {
         loop {
             match self.chain.pop() {
                 Some(mut next) => {
-                    this.map(|e| next.children.entries.push(e));
+                    next.children.entries.extend(this);
                     if next.level < level {
                         // this is the parent we want, so return it to
                         // its rightful place.
@@ -105,7 +105,7 @@ impl TocBuilder {
                     }
                 }
                 None => {
-                    this.map(|e| self.top_level.entries.push(e));
+                    self.top_level.entries.extend(this);
                     return;
                 }
             }