Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik
Update exception-safety.md Fix variable name typo
This commit is contained in:
commit
6f9e69a0fd
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user