From 84ca464f9c731b07a68cb264ecd37c9aacc2e475 Mon Sep 17 00:00:00 2001 From: Luxko Date: Thu, 23 Feb 2017 01:44:27 -0600 Subject: [PATCH 1/2] Update exception-safety.md Fix variable name typo --- src/doc/nomicon/src/exception-safety.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/nomicon/src/exception-safety.md b/src/doc/nomicon/src/exception-safety.md index 80e72cd5e36c9..0fb98a617688e 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 From 729948f95853e0d7228e02dffca53539ddb0a9e0 Mon Sep 17 00:00:00 2001 From: Luxko Date: Thu, 23 Feb 2017 01:50:16 -0600 Subject: [PATCH 2/2] Update exception-safety.md --- src/doc/nomicon/src/exception-safety.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/nomicon/src/exception-safety.md b/src/doc/nomicon/src/exception-safety.md index 0fb98a617688e..a3cbc6abd69cc 100644 --- a/src/doc/nomicon/src/exception-safety.md +++ b/src/doc/nomicon/src/exception-safety.md @@ -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: