Skip to content

Commit 609ae8a

Browse files
authored
Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik
Update exception-safety.md Fix variable name typo
2 parents 837cc4f + 729948f commit 609ae8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/nomicon/src/exception-safety.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ uselessly. We would rather have the following:
9393
```text
9494
bubble_up(heap, index):
9595
let elem = heap[index]
96-
while index != 0 && element < heap[parent(index)]:
96+
while index != 0 && elem < heap[parent(index)]:
9797
heap[index] = heap[parent(index)]
9898
index = parent(index)
9999
heap[index] = elem
@@ -137,7 +137,7 @@ If Rust had `try` and `finally` like in Java, we could do the following:
137137
bubble_up(heap, index):
138138
let elem = heap[index]
139139
try:
140-
while index != 0 && element < heap[parent(index)]:
140+
       while index != 0 && elem < heap[parent(index)]:
141141
heap[index] = heap[parent(index)]
142142
index = parent(index)
143143
finally:

0 commit comments

Comments
 (0)