@@ -255,11 +255,11 @@ Code in between possible suspension points runs sequentially,
255255without the possibility of interruption from other concurrent code.
256256For example, the code below moves a picture from one gallery to another.
257257
258- ```
258+ ``` swift
259259let firstPhoto = await listPhotos (inGallery : " Summer Vacation" )[0 ]
260- add(firstPhoto toGallery: "Road Trip")
260+ add (firstPhoto, toGallery : " Road Trip" )
261261// At this point, firstPhoto is temporarily in both galleries.
262- remove(firstPhoto fromGallery: "Summer Vacation")
262+ remove (firstPhoto, fromGallery : " Summer Vacation" )
263263```
264264
265265
@@ -271,10 +271,10 @@ To make it even clearer that this chunk of code
271271must not have ` await ` added to it in the future,
272272you can refactor that code into a synchronous function:
273273
274- ```
274+ ``` swift
275275func move (_ photoName : String , from source : String , to destination : String ) {
276- add(photoName, to : destination)
277- remove(photoName, from : source)
276+ add (photoName, toGallery : destination)
277+ remove (photoName, fromGallery : source)
278278}
279279// ...
280280let firstPhoto = await listPhotos (inGallery : " Summer Vacation" )[0 ]
0 commit comments