Skip to content

Commit ac7342f

Browse files
committed
Specify code listings are in Swift.
Otherwise they don't get syntax highlighting. These listings went down a different RST-to-markdown export path because they couldn't use the tested code listing setup in the old RST-based build system.
1 parent d7ec7c2 commit ac7342f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/TSPL/TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ the explicit parent-child relationships between tasks
557557
lets Swift handle some behaviors like propagating cancellation for you,
558558
and lets Swift detect some errors at compile time.
559559

560-
```
560+
```swift
561561
await withTaskGroup(of: Data.self) { taskGroup in
562562
let photoNames = await listPhotos(inGallery: "Summer Vacation")
563563
for name in photoNames {
@@ -706,7 +706,7 @@ call the [Task.detached(priority:operation:)](https://developer.apple.com/docume
706706
Both of these operations return a task that you can interact with ---
707707
for example, to wait for its result or to cancel it.
708708

709-
```
709+
```swift
710710
let newPhoto = // ... some photo data ...
711711
let handle = Task {
712712
return await add(newPhoto, toGalleryNamed: "Spring Adventures")
@@ -840,7 +840,7 @@ When you access a property or method of an actor,
840840
you use `await` to mark the potential suspension point.
841841
For example:
842842

843-
```
843+
```swift
844844
let logger = TemperatureLogger(label: "Outdoors", measurement: 25)
845845
print(await logger.max)
846846
// Prints "25"
@@ -858,7 +858,7 @@ when accessing the actor's properties.
858858
For example,
859859
here's a method that updates a `TemperatureLogger` with a new temperature:
860860

861-
```
861+
```swift
862862
extension TemperatureLogger {
863863
func update(with measurement: Int) {
864864
measurements.append(measurement)
@@ -906,7 +906,7 @@ like you would with an instance of a class,
906906
you'll get a compile-time error.
907907
For example:
908908

909-
```
909+
```swift
910910
print(logger.max) // Error
911911
```
912912

0 commit comments

Comments
 (0)