Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik

Update exception-safety.md

Fix variable name typo
This commit is contained in:
Guillaume Gomez 2017-02-24 13:22:59 +01:00 committed by GitHub
commit 6f9e69a0fd

View File

@ -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: