Skip to content

Commit 72f6eb7

Browse files
authored
Fix code in Result example (#269)
The previous code listing is missing a generic parameter, depends on an async version of Result.init(catching:) that isn't actually in the stdlib, and could be confusing because it mixes async and throwing code.
2 parents 4487819 + 64bbdf2 commit 72f6eb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ from nonthrowing code.
334334
For example:
335335

336336
```swift
337-
func getRainyWeekendPhotos() async -> Result<[String]> {
337+
func availableRainyWeekendPhotos() -> Result<[String], Error> {
338338
return Result {
339-
try await listPhotos(inGallery: "A Rainy Weekend")
339+
try listDownloadedPhotos(inGallery: "A Rainy Weekend")
340340
}
341341
}
342342
```

0 commit comments

Comments
 (0)