Skip to content

Commit

Permalink
Fix typo in BoundedBufferStateMachine (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
GavrilikArt authored Oct 2, 2023
1 parent cb41700 commit 5bbdcc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct BoundedBufferStateMachine<Base: AsyncSequence> {
mutating func shouldSuspendProducer() -> Bool {
switch state {
case .initial:
preconditionFailure("Invalid state. The task should already by started.")
preconditionFailure("Invalid state. The task should already be started.")

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

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

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

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

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

0 comments on commit 5bbdcc1

Please sign in to comment.