Skip to content

Commit 5bbdcc1

Browse files
authored
Fix typo in BoundedBufferStateMachine (#301)
1 parent cb41700 commit 5bbdcc1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
6464
mutating func shouldSuspendProducer() -> Bool {
6565
switch state {
6666
case .initial:
67-
preconditionFailure("Invalid state. The task should already by started.")
67+
preconditionFailure("Invalid state. The task should already be started.")
6868

6969
case .buffering(_, let buffer, .none, .none):
7070
// we are either idle or the buffer is already in use (no awaiting consumer)
@@ -95,7 +95,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
9595
mutating func producerSuspended(continuation: SuspendedProducer) -> ProducerSuspendedAction {
9696
switch self.state {
9797
case .initial:
98-
preconditionFailure("Invalid state. The task should already by started.")
98+
preconditionFailure("Invalid state. The task should already be started.")
9999

100100
case .buffering(let task, let buffer, .none, .none):
101101
// we are either idle or the buffer is already in use (no awaiting consumer)
@@ -132,7 +132,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
132132
mutating func elementProduced(element: Element) -> ElementProducedAction {
133133
switch self.state {
134134
case .initial:
135-
preconditionFailure("Invalid state. The task should already by started.")
135+
preconditionFailure("Invalid state. The task should already be started.")
136136

137137
case .buffering(let task, var buffer, .none, .none):
138138
// we are either idle or the buffer is already in use (no awaiting consumer)
@@ -170,7 +170,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
170170
mutating func finish(error: Error?) -> FinishAction {
171171
switch self.state {
172172
case .initial:
173-
preconditionFailure("Invalid state. The task should already by started.")
173+
preconditionFailure("Invalid state. The task should already be started.")
174174

175175
case .buffering(_, var buffer, .none, .none):
176176
// we are either idle or the buffer is already in use (no awaiting consumer)
@@ -245,7 +245,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
245245
mutating func nextSuspended(continuation: SuspendedConsumer) -> NextSuspendedAction {
246246
switch self.state {
247247
case .initial:
248-
preconditionFailure("Invalid state. The task should already by started.")
248+
preconditionFailure("Invalid state. The task should already be started.")
249249

250250
case .buffering(let task, let buffer, .none, .none) where buffer.isEmpty:
251251
// we are idle, we confirm the suspension of the consumer

0 commit comments

Comments
 (0)