Skip to content

Commit

Permalink
Rollup merge of rust-lang#40050 - DaseinPhaos:patch-3, r=steveklabnik
Browse files Browse the repository at this point in the history
Update exception-safety.md

Fix variable name typo
  • Loading branch information
GuillaumeGomez authored Feb 24, 2017
2 parents 173b725 + 729948f commit 6f9e69a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/doc/nomicon/src/exception-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6f9e69a

Please sign in to comment.