From 5bbdcc1d37990cca524852c5a3924c02fa2da983 Mon Sep 17 00:00:00 2001 From: Artem Gavrilik <73897254+GavrilikArt@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:42:24 +0200 Subject: [PATCH] Fix typo in BoundedBufferStateMachine (#301) --- .../Buffer/BoundedBufferStateMachine.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift b/Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift index 9ca7a993..5c99d3d7 100644 --- a/Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift +++ b/Sources/AsyncAlgorithms/Buffer/BoundedBufferStateMachine.swift @@ -64,7 +64,7 @@ struct BoundedBufferStateMachine { 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) @@ -95,7 +95,7 @@ struct BoundedBufferStateMachine { 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) @@ -132,7 +132,7 @@ struct BoundedBufferStateMachine { 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) @@ -170,7 +170,7 @@ struct BoundedBufferStateMachine { 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) @@ -245,7 +245,7 @@ struct BoundedBufferStateMachine { 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