From 13a21a03838050b91e4f034dfd94dfa66ae42b72 Mon Sep 17 00:00:00 2001 From: Kevin Tan Date: Mon, 2 May 2022 22:26:56 -0700 Subject: [PATCH 1/2] fix typos --- Sources/AsyncAlgorithms/AsyncChannel.swift | 8 ++++---- Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncChannel.swift b/Sources/AsyncAlgorithms/AsyncChannel.swift index f6d132f4..a9922a90 100644 --- a/Sources/AsyncAlgorithms/AsyncChannel.swift +++ b/Sources/AsyncAlgorithms/AsyncChannel.swift @@ -13,10 +13,10 @@ /// /// The `AsyncChannel` class is intended to be used as a communication type between tasks, /// particularly when one task produces values and another task consumes those values. The back -/// pressure applied by `send(_:)` and `finish()` via the suspension/resume ensure that -/// the production of values does not exceed the consumption of values from iteration. Each of these -/// methods suspends after enqueuing the event and is resumed when the next call to `next()` -/// on the `Iterator` is made. +/// pressure applied by `send(_:)` and `finish()` via the suspension/resume ensures that +/// the production of values does not exceed the consumption of values from iteration. Each of these +/// methods suspends after enqueuing the event and is resumed when the next call to `next()` +/// on the `Iterator` is made. public final class AsyncChannel: AsyncSequence, Sendable { /// The iterator for a `AsyncChannel` instance. public struct Iterator: AsyncIteratorProtocol, Sendable { diff --git a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift index 7a9e9a3c..92e2a258 100644 --- a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift @@ -37,6 +37,7 @@ extension AsyncSequence { /// error, `AsyncChunkedByGroupSequence` will rethrow that error immediately and discard /// any current group. /// +/// let numbers = [10, 20, 30, 10, 40, 40, 10, 20] /// let chunks = numbers.chunked { $0 <= $1 } /// for await numberChunk in chunks { /// print(numberChunk) From 5b50fa5739db2b7a39a7d4746eaa89757f84ead2 Mon Sep 17 00:00:00 2001 From: Kevin Tan Date: Tue, 3 May 2022 20:37:12 -0700 Subject: [PATCH 2/2] add async modifier to doc --- Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift index 92e2a258..98154625 100644 --- a/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChunkedByGroupSequence.swift @@ -37,7 +37,7 @@ extension AsyncSequence { /// error, `AsyncChunkedByGroupSequence` will rethrow that error immediately and discard /// any current group. /// -/// let numbers = [10, 20, 30, 10, 40, 40, 10, 20] +/// let numbers = [10, 20, 30, 10, 40, 40, 10, 20].async /// let chunks = numbers.chunked { $0 <= $1 } /// for await numberChunk in chunks { /// print(numberChunk)