Skip to content

Commit 771b22d

Browse files
author
Chris Adamson
committed
Style fixes to Async(Throwing)Stream docs.
1 parent f6e3df8 commit 771b22d

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

stdlib/public/Concurrency/AsyncStream.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ public struct AsyncStream<Element> {
104104
/// calling one of the `yield` methods, then terminate the stream normally by
105105
/// calling the `finish()` method.
106106
public struct Continuation: Sendable {
107-
/// A type that indicates how the stream terminated.
108-
///
109-
/// The `onTermination` closure receives an instance of this type.
110-
public enum Termination {
107+
/// A type that indicates how the stream terminated.
108+
///
109+
/// The `onTermination` closure receives an instance of this type.
110+
public enum Termination {
111111

112112
/// The stream finished as a result of calling the continuation's
113113
/// `finish` method.
@@ -133,13 +133,13 @@ public struct AsyncStream<Element> {
133133
/// yield are mutually exclusive.
134134
case enqueued(remaining: Int)
135135

136-
/// The stream did not enqueue the element due to a full buffer.
136+
/// The stream didn't enqueue the element due to a full buffer.
137137
///
138138
/// The associated element for this case is the element that the stream
139139
/// dropped.
140140
case dropped(Element)
141141

142-
/// The stream did not enqueue the element because the stream was in a
142+
/// The stream didn't enqueue the element because the stream was in a
143143
/// terminal state.
144144
///
145145
/// This indicates the stream terminated prior to calling `yield`, either

stdlib/public/Concurrency/AsyncThrowingStream.swift

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,29 @@ import Swift
115115
@available(SwiftStdlib 5.5, *)
116116
public struct AsyncThrowingStream<Element, Failure: Error> {
117117

118-
/// A mechanism to interface between synchronous code and an asynchronous
119-
/// stream.
120-
///
121-
/// The closure you provide to the `AsyncThrowingStream` in
122-
/// `init(_:bufferingPolicy:_:)` receives an instance of this type when
123-
/// invoked. Use this continuation to provide elements to the stream by
124-
/// calling one of the `yield` methods, then terminate the stream normally by
125-
/// calling the `finish()` method. You can also use the continuation's
126-
/// `finish(throwing:)` method to terminate the stream by throwing an error.
127-
public struct Continuation: Sendable {
118+
/// A mechanism to interface between synchronous code and an asynchronous
119+
/// stream.
120+
///
121+
/// The closure you provide to the `AsyncThrowingStream` in
122+
/// `init(_:bufferingPolicy:_:)` receives an instance of this type when
123+
/// invoked. Use this continuation to provide elements to the stream by
124+
/// calling one of the `yield` methods, then terminate the stream normally by
125+
/// calling the `finish()` method. You can also use the continuation's
126+
/// `finish(throwing:)` method to terminate the stream by throwing an error.
127+
public struct Continuation: Sendable {
128128
/// A type that indicates how the stream terminated.
129129
///
130130
/// The `onTermination` closure receives an instance of this type.
131131
public enum Termination {
132132

133-
/// The stream finished as a result of calling the continuation's
134-
/// `finish` method.
135-
///
136-
/// The associated `Failure` value provides the error that terminated
137-
/// the stream. If no error occurred, this value is `nil`.
133+
/// The stream finished as a result of calling the continuation's
134+
/// `finish` method.
135+
///
136+
/// The associated `Failure` value provides the error that terminated
137+
/// the stream. If no error occurred, this value is `nil`.
138138
case finished(Failure?)
139139

140-
/// The stream finished as a result of cancellation.
140+
/// The stream finished as a result of cancellation.
141141
case cancelled
142142
}
143143

@@ -157,17 +157,18 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
157157
/// yield are mutually exclusive.
158158
case enqueued(remaining: Int)
159159

160-
/// The stream did not enqueue the element due to a full buffer.
160+
/// The stream didn't enqueue the element due to a full buffer.
161161
///
162162
/// The associated element for this case is the element that the stream
163163
/// dropped.
164164
case dropped(Element)
165165

166-
/// The stream did not enqueue the element because the stream was in a
167-
/// terminal state.
168-
///
169-
/// This indicates the stream terminated prior to calling `yield`, either
170-
/// because the stream finished normally or through cancellation.
166+
/// The stream didn't enqueue the element because the stream was in a
167+
/// terminal state.
168+
///
169+
/// This indicates the stream terminated prior to calling `yield`, either
170+
/// because the stream finished normally or through cancellation, or
171+
/// threw an error
171172
case terminated
172173
}
173174

0 commit comments

Comments
 (0)