about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-02-24 13:22:59 +0100
committerGitHub <noreply@github.com>2017-02-24 13:22:59 +0100
commit6f9e69a0fdf0bcf89281b6aefa14ecde2a111665 (patch)
treeae69bcb91a49dc525f4ef58330e3e3619884b7d6 /src
parent173b725b89d1cb61a3ae54aa7778d08673e79988 (diff)
parent729948f95853e0d7228e02dffca53539ddb0a9e0 (diff)
downloadrust-6f9e69a0fdf0bcf89281b6aefa14ecde2a111665.tar.gz
rust-6f9e69a0fdf0bcf89281b6aefa14ecde2a111665.zip
Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik
Update exception-safety.md

Fix variable name typo
Diffstat (limited to 'src')
-rw-r--r--src/doc/nomicon/src/exception-safety.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/doc/nomicon/src/exception-safety.md b/src/doc/nomicon/src/exception-safety.md
index 80e72cd5e36..a3cbc6abd69 100644
--- a/src/doc/nomicon/src/exception-safety.md
+++ b/src/doc/nomicon/src/exception-safety.md
@@ -93,7 +93,7 @@ uselessly. We would rather have the following:
 ```text
 bubble_up(heap, index):
     let elem = heap[index]
-    while index != 0 && element < heap[parent(index)]:
+    while index != 0 && elem < heap[parent(index)]:
         heap[index] = heap[parent(index)]
         index = parent(index)
     heap[index] = elem
@@ -137,7 +137,7 @@ If Rust had `try` and `finally` like in Java, we could do the following:
 bubble_up(heap, index):
     let elem = heap[index]
     try:
-        while index != 0 && element < heap[parent(index)]:
+        while index != 0 && elem < heap[parent(index)]:
             heap[index] = heap[parent(index)]
             index = parent(index)
     finally: