From 0dfb244b1b3b662a56360f07a85b0eaaf3919132 Mon Sep 17 00:00:00 2001 From: Reza Shirazian Date: Sun, 27 Mar 2022 08:19:52 -0700 Subject: [PATCH] Fixing a few typos (#115) This PR fixes a few typos across various comments in the code. --- Sources/AsyncAlgorithms/AsyncBufferSequence.swift | 2 +- Sources/AsyncAlgorithms/AsyncChain2Sequence.swift | 2 +- Sources/AsyncAlgorithms/AsyncChain3Sequence.swift | 2 +- Sources/AsyncAlgorithms/AsyncDebounceSequence.swift | 2 +- Sources/AsyncAlgorithms/AsyncLazySequence.swift | 4 ++-- Sources/AsyncAlgorithms/AsyncMerge2Sequence.swift | 2 +- Sources/AsyncAlgorithms/AsyncMerge3Sequence.swift | 4 ++-- Sources/AsyncAlgorithms/Rethrow.swift | 2 +- Sources/AsyncSequenceValidation/WorkQueue.swift | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncBufferSequence.swift b/Sources/AsyncAlgorithms/AsyncBufferSequence.swift index 258b66e..b5867ab 100644 --- a/Sources/AsyncAlgorithms/AsyncBufferSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncBufferSequence.swift @@ -203,7 +203,7 @@ extension AsyncSequence where Element: Sendable { /// /// Use the `buffer(_:)` method to account for `AsyncSequence` types that may produce elements faster /// than they are iterated. The `createBuffer` closure returns a backing buffer for storing elements and dealing with - /// behavioral charcteristics of the `buffer(_:)` algorithm. + /// behavioral characteristics of the `buffer(_:)` algorithm. /// /// - Parameter createBuffer: A closure that constructs a new `AsyncBuffer` actor to store buffered values. /// - Returns: An asynchronous sequence that buffers elements using the specified `AsyncBuffer`. diff --git a/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift b/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift index ed7ab7e..59d3cfe 100644 --- a/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift @@ -15,7 +15,7 @@ /// - Parameters: /// - s1: The first asynchronous sequence. /// - s2: The second asynchronous sequence. -/// - Returns: An asynchonous sequence that iterates first over the elements of `s1`, and +/// - Returns: An asynchronous sequence that iterates first over the elements of `s1`, and /// then over the elements of `s2`. @inlinable public func chain(_ s1: Base1, _ s2: Base2) -> AsyncChain2Sequence where Base1.Element == Base2.Element { diff --git a/Sources/AsyncAlgorithms/AsyncChain3Sequence.swift b/Sources/AsyncAlgorithms/AsyncChain3Sequence.swift index c0929ee..8185a22 100644 --- a/Sources/AsyncAlgorithms/AsyncChain3Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChain3Sequence.swift @@ -16,7 +16,7 @@ /// - s1: The first asynchronous sequence. /// - s2: The second asynchronous sequence. /// - s3: The third asynchronous sequence. -/// - Returns: An asynchonous sequence that iterates first over the elements of `s1`, and +/// - Returns: An asynchronous sequence that iterates first over the elements of `s1`, and /// then over the elements of `s2`, and then over the elements of `s3` @inlinable public func chain(_ s1: Base1, _ s2: Base2, _ s3: Base3) -> AsyncChain3Sequence { diff --git a/Sources/AsyncAlgorithms/AsyncDebounceSequence.swift b/Sources/AsyncAlgorithms/AsyncDebounceSequence.swift index 9438a79..9ad9aef 100644 --- a/Sources/AsyncAlgorithms/AsyncDebounceSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncDebounceSequence.swift @@ -11,7 +11,7 @@ extension AsyncSequence { /// Creates an asynchronous sequence that emits the latest element after a given quiescence period - /// has elapsed by using a spectified Clock. + /// has elapsed by using a specified Clock. @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) public func debounce(for interval: C.Instant.Duration, tolerance: C.Instant.Duration? = nil, clock: C) -> AsyncDebounceSequence { AsyncDebounceSequence(self, interval: interval, tolerance: tolerance, clock: clock) diff --git a/Sources/AsyncAlgorithms/AsyncLazySequence.swift b/Sources/AsyncAlgorithms/AsyncLazySequence.swift index b8eed7e..9c2aa1e 100644 --- a/Sources/AsyncAlgorithms/AsyncLazySequence.swift +++ b/Sources/AsyncAlgorithms/AsyncLazySequence.swift @@ -22,10 +22,10 @@ extension Sequence { /// An asynchronous sequence composed from a synchronous sequence. /// /// Asynchronous lazy sequences can be used to interface existing or pre-calculated -/// data to interoperate with other asynchronous sequences and algoritms based on +/// data to interoperate with other asynchronous sequences and algorithms based on /// asynchronous sequences. /// -/// This functions similarly to `LazySequence` by accessing elemetns sequentially +/// This functions similarly to `LazySequence` by accessing elements sequentially /// in the iterator's `next()` method. @frozen public struct AsyncLazySequence: AsyncSequence { diff --git a/Sources/AsyncAlgorithms/AsyncMerge2Sequence.swift b/Sources/AsyncAlgorithms/AsyncMerge2Sequence.swift index ac220ec..eeaf024 100644 --- a/Sources/AsyncAlgorithms/AsyncMerge2Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncMerge2Sequence.swift @@ -174,7 +174,7 @@ extension Merge2StateMachine.Either where Base1.Element == Base2.Element { /// An asynchronous sequence of elements from two underlying asynchronous sequences /// /// In a `AsyncMerge2Sequence` instance, the *i*th element is the *i*th element -/// resolved in sequential order out of the two underyling asynchronous sequences. +/// resolved in sequential order out of the two underlying asynchronous sequences. /// Use the `merge(_:_:)` function to create an `AsyncMerge2Sequence`. public struct AsyncMerge2Sequence: AsyncSequence, Sendable where diff --git a/Sources/AsyncAlgorithms/AsyncMerge3Sequence.swift b/Sources/AsyncAlgorithms/AsyncMerge3Sequence.swift index e34ce6c..efbbf9a 100644 --- a/Sources/AsyncAlgorithms/AsyncMerge3Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncMerge3Sequence.swift @@ -23,7 +23,7 @@ where /// An asynchronous sequence of elements from three underlying asynchronous sequences /// /// In a `AsyncMerge3Sequence` instance, the *i*th element is the *i*th element -/// resolved in sequential order out of the two underyling asynchronous sequences. +/// resolved in sequential order out of the two underlying asynchronous sequences. /// Use the `merge(_:_:_:)` function to create an `AsyncMerge3Sequence`. public struct AsyncMerge3Sequence: AsyncSequence, Sendable where @@ -206,7 +206,7 @@ where return try await apply(task1, task2, nil) // 2 terminal - // these can be permuted in place since they dont need to run two or more tasks at once + // these can be permuted in place since they don't need to run two or more tasks at once case (.terminal, .terminal, .idle(var iterator3)): do { if let value = try await iterator3.next() { diff --git a/Sources/AsyncAlgorithms/Rethrow.swift b/Sources/AsyncAlgorithms/Rethrow.swift index 13c2e8b..6edf4a4 100644 --- a/Sources/AsyncAlgorithms/Rethrow.swift +++ b/Sources/AsyncAlgorithms/Rethrow.swift @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -// This is a hack around the fact that we dont have generic effects +// This is a hack around the fact that we don't have generic effects // alternatively in the use cases we would want `rethrows(unsafe)` // or something like that to avoid this nifty hack... diff --git a/Sources/AsyncSequenceValidation/WorkQueue.swift b/Sources/AsyncSequenceValidation/WorkQueue.swift index 66722c3..929ff55 100644 --- a/Sources/AsyncSequenceValidation/WorkQueue.swift +++ b/Sources/AsyncSequenceValidation/WorkQueue.swift @@ -144,7 +144,7 @@ struct WorkQueue: Sendable { items.append(queue.removeFirst()) } queues[job] = queue - // if there is nothing left in this queue then dont bother with it anymore + // if there is nothing left in this queue then don't bother with it anymore if queue.count == 0 { jobsToRemove.insert(jobIndex) }