From 92747901e0d80733ab1bdef286090ab8dcbe5698 Mon Sep 17 00:00:00 2001 From: Philippe Hausler Date: Fri, 23 Jun 2023 06:40:09 -0700 Subject: [PATCH] Audit pass on inline and initialization (#271) --- .../AsyncInclusiveReductionsSequence.swift | 2 +- .../AsyncThrowingInclusiveReductionsSequence.swift | 2 +- Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift | 8 ++++---- .../CombineLatest/AsyncCombineLatest2Sequence.swift | 2 +- .../AsyncAlgorithms/Debounce/AsyncDebounceSequence.swift | 2 +- .../Interspersed/AsyncInterspersedSequence.swift | 4 ++-- Sources/AsyncAlgorithms/Merge/AsyncMerge2Sequence.swift | 2 +- Sources/AsyncAlgorithms/Merge/AsyncMerge3Sequence.swift | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncInclusiveReductionsSequence.swift b/Sources/AsyncAlgorithms/AsyncInclusiveReductionsSequence.swift index 12611c14..0dab7cb0 100644 --- a/Sources/AsyncAlgorithms/AsyncInclusiveReductionsSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncInclusiveReductionsSequence.swift @@ -58,7 +58,7 @@ extension AsyncInclusiveReductionsSequence: AsyncSequence { internal let transform: @Sendable (Base.Element, Base.Element) async -> Base.Element @inlinable - internal init( + init( _ iterator: Base.AsyncIterator, transform: @Sendable @escaping (Base.Element, Base.Element) async -> Base.Element ) { diff --git a/Sources/AsyncAlgorithms/AsyncThrowingInclusiveReductionsSequence.swift b/Sources/AsyncAlgorithms/AsyncThrowingInclusiveReductionsSequence.swift index 36e88fb5..2a03304f 100644 --- a/Sources/AsyncAlgorithms/AsyncThrowingInclusiveReductionsSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncThrowingInclusiveReductionsSequence.swift @@ -57,7 +57,7 @@ extension AsyncThrowingInclusiveReductionsSequence: AsyncSequence { internal let transform: @Sendable (Base.Element, Base.Element) async throws -> Base.Element @inlinable - internal init( + init( _ iterator: Base.AsyncIterator, transform: @Sendable @escaping (Base.Element, Base.Element) async throws -> Base.Element ) { diff --git a/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift b/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift index 8049a1a0..817615a4 100644 --- a/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift +++ b/Sources/AsyncAlgorithms/Buffer/AsyncBufferSequence.swift @@ -70,7 +70,7 @@ public struct AsyncBufferSequencePolicy: Sendable { /// An `AsyncSequence` that buffers elements in regard to a policy. public struct AsyncBufferSequence: AsyncSequence { - enum StorageType { + enum StorageType { case transparent(Base.AsyncIterator) case bounded(storage: BoundedBufferStorage) case unbounded(storage: UnboundedBufferStorage) @@ -82,7 +82,7 @@ public struct AsyncBufferSequence: AsyncSequence let base: Base let policy: AsyncBufferSequencePolicy - public init( + init( base: Base, policy: AsyncBufferSequencePolicy ) { @@ -91,7 +91,7 @@ public struct AsyncBufferSequence: AsyncSequence } public func makeAsyncIterator() -> Iterator { - let storageType: StorageType + let storageType: StorageType switch self.policy.policy { case .bounded(...0), .bufferingNewest(...0), .bufferingOldest(...0): storageType = .transparent(self.base.makeAsyncIterator()) @@ -108,7 +108,7 @@ public struct AsyncBufferSequence: AsyncSequence } public struct Iterator: AsyncIteratorProtocol { - var storageType: StorageType + var storageType: StorageType public mutating func next() async rethrows -> Element? { switch self.storageType { diff --git a/Sources/AsyncAlgorithms/CombineLatest/AsyncCombineLatest2Sequence.swift b/Sources/AsyncAlgorithms/CombineLatest/AsyncCombineLatest2Sequence.swift index c07bd099..f8fd86cc 100644 --- a/Sources/AsyncAlgorithms/CombineLatest/AsyncCombineLatest2Sequence.swift +++ b/Sources/AsyncAlgorithms/CombineLatest/AsyncCombineLatest2Sequence.swift @@ -46,7 +46,7 @@ public struct AsyncCombineLatest2Sequence< let base1: Base1 let base2: Base2 - public init(_ base1: Base1, _ base2: Base2) { + init(_ base1: Base1, _ base2: Base2) { self.base1 = base1 self.base2 = base2 } diff --git a/Sources/AsyncAlgorithms/Debounce/AsyncDebounceSequence.swift b/Sources/AsyncAlgorithms/Debounce/AsyncDebounceSequence.swift index 5ae17f14..e2f8b7a9 100644 --- a/Sources/AsyncAlgorithms/Debounce/AsyncDebounceSequence.swift +++ b/Sources/AsyncAlgorithms/Debounce/AsyncDebounceSequence.swift @@ -41,7 +41,7 @@ public struct AsyncDebounceSequence: Sendable whe /// - interval: The interval to debounce. /// - tolerance: The tolerance of the clock. /// - clock: The clock. - public init(_ base: Base, interval: C.Instant.Duration, tolerance: C.Instant.Duration?, clock: C) { + init(_ base: Base, interval: C.Instant.Duration, tolerance: C.Instant.Duration?, clock: C) { self.base = base self.interval = interval self.tolerance = tolerance diff --git a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift index 7dd08c53..18398f9f 100644 --- a/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift +++ b/Sources/AsyncAlgorithms/Interspersed/AsyncInterspersedSequence.swift @@ -45,7 +45,7 @@ public struct AsyncInterspersedSequence { internal let separator: Base.Element @usableFromInline - internal init(_ base: Base, separator: Base.Element) { + init(_ base: Base, separator: Base.Element) { self.base = base self.separator = separator } @@ -73,7 +73,7 @@ extension AsyncInterspersedSequence: AsyncSequence { internal var state = State.start @usableFromInline - internal init(_ iterator: Base.AsyncIterator, separator: Base.Element) { + init(_ iterator: Base.AsyncIterator, separator: Base.Element) { self.iterator = iterator self.separator = separator } diff --git a/Sources/AsyncAlgorithms/Merge/AsyncMerge2Sequence.swift b/Sources/AsyncAlgorithms/Merge/AsyncMerge2Sequence.swift index 2723d112..c1a45ba3 100644 --- a/Sources/AsyncAlgorithms/Merge/AsyncMerge2Sequence.swift +++ b/Sources/AsyncAlgorithms/Merge/AsyncMerge2Sequence.swift @@ -40,7 +40,7 @@ public struct AsyncMerge2Sequence< /// - Parameters: /// - base1: The first upstream ``Swift/AsyncSequence``. /// - base2: The second upstream ``Swift/AsyncSequence``. - public init( + init( _ base1: Base1, _ base2: Base2 ) { diff --git a/Sources/AsyncAlgorithms/Merge/AsyncMerge3Sequence.swift b/Sources/AsyncAlgorithms/Merge/AsyncMerge3Sequence.swift index c2b54eb1..6f5abf13 100644 --- a/Sources/AsyncAlgorithms/Merge/AsyncMerge3Sequence.swift +++ b/Sources/AsyncAlgorithms/Merge/AsyncMerge3Sequence.swift @@ -49,7 +49,7 @@ public struct AsyncMerge3Sequence< /// - base1: The first upstream ``Swift/AsyncSequence``. /// - base2: The second upstream ``Swift/AsyncSequence``. /// - base3: The third upstream ``Swift/AsyncSequence``. - public init( + init( _ base1: Base1, _ base2: Base2, _ base3: Base3