Fix zip example (#119)

This commit is contained in:
Vikram Kriplaney authored and GitHub committed 2022-03-28 11:08:46 -07:00
1 parent 0dfb244b1b
commit 739815f65d
1 file changed
+3 -3
+3 -3
View File
@@ -6,10 +6,10 @@
Combines the latest values produced from two or more asynchronous sequences into an asynchronous sequence of tuples.
```swift
let appleFeed = URL("http://www.example.com/ticker?symbol=AAPL").lines
let nasdaqFeed = URL("http://www.example.com/ticker?symbol=^IXIC").lines
let appleFeed = URL(string: "http://www.example.com/ticker?symbol=AAPL")!.lines
let nasdaqFeed = URL(string: "http://www.example.com/ticker?symbol=^IXIC")!.lines
for try await (apple, nasdaq) = zip(appleFeed, nasdaqFeed) {
for try await (apple, nasdaq) in zip(appleFeed, nasdaqFeed) {
print("APPL: \(apple) NASDAQ: \(nasdaq)")
}
```