From 1b7c52893981c04f938f2493676060521f6489bb Mon Sep 17 00:00:00 2001 From: GavrilikArt Date: Mon, 2 Oct 2023 17:05:19 +0200 Subject: [PATCH] Fix typo in BoundedBufferStateMachine --- .../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