From c1492317c02920b941c9ae874edc9a5cefb1798f Mon Sep 17 00:00:00 2001 From: Ryan Sobol Date: Thu, 31 Dec 2020 08:05:12 -0800 Subject: [PATCH] Add try await keywords when chopping veggies Is this code example missing the `try await` keywords when chopping veggies? In the previous example, inside the loop that would not produce any meaningful concurrency, line 190 is written: ```swift veggies[i] = try await veggies[i].chopped() ``` It seems like the `chopped()` method has the potential for a kitchen knife incident for each veggie. I assume this needs to be accounted for in the meaningful concurrency example too? --- proposals/nnnn-structured-concurrency.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/nnnn-structured-concurrency.md b/proposals/nnnn-structured-concurrency.md index 440d58d8dc..e984670b34 100644 --- a/proposals/nnnn-structured-concurrency.md +++ b/proposals/nnnn-structured-concurrency.md @@ -206,7 +206,7 @@ func chopVegetables() async throws -> [Vegetable] { // chopped. for i in veggies.indices { await group.add { - (i, veggies[i].chopped()) + (i, try await veggies[i].chopped()) } }