Skip to content

Commit 3b3810c

Browse files
author
Thibault Wittemberg
committed
project: address Swiftlint issues
1 parent 0b3f8f5 commit 3b3810c

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

Sources/AsyncSequences/AsyncSequences+Merge.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public struct AsyncMergeSequence<UpstreamAsyncSequence: AsyncSequence>: AsyncSeq
9090
// }
9191

9292
public struct Iterator: AsyncIteratorProtocol {
93-
9493
var downstreamIterator: AsyncStreams.Passthrough<UpstreamElement>.AsyncIterator
9594
let upstreamAsyncSequenceRegulators: [ConcurrentAccessRegulator<UpstreamAsyncSequence>]
9695
// let elementCounter = ElementCounter()

Sources/AsyncStreams/AsyncStreams+Passthrough.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class AsyncPassthroughStream<Element>: Stream, @unchecked Sendable
4343
// because of its async nature. Doing so, it means that we could call `send` while the registration is not done and we
4444
// would loose the value.
4545
let serialQueue = DispatchQueue(label: UUID().uuidString)
46-
46+
4747
let continuations = AsyncStreams.Continuations<Element>()
4848

4949
public init() {}

Sources/AsyncStreams/AsyncStreams+Replay.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public final class AsyncReplayStream<Element>: Stream, @unchecked Sendable {
6363
// because of its async nature. Doing so, it means that we could call `send` while the registration is not done and we
6464
// would loose the value.
6565
let serialQueue = DispatchQueue(label: UUID().uuidString)
66-
66+
6767
let continuations = AsyncStreams.Continuations<Element>()
6868
let storage: Storage
6969

Sources/AsyncStreams/AsyncStreams.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum AsyncStreams {}
1717
extension AsyncStreams {
1818
// Continuations can be accessed in a concurrent context. It is up to the caller to ensure
1919
// the usage in a safe way (cf Passthrough, CurrrentValue and Replay)
20-
final class Continuations<Element>{
20+
final class Continuations<Element> {
2121
var continuations = [AnyHashable: AsyncThrowingStream<Element, Error>.Continuation]()
2222

2323
func send(_ element: Element) {

Sources/Internal/ConcurrentAccessRegulator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ final class ConcurrentAccessRegulator<UpstreamAsyncSequence: AsyncSequence>: @un
5959
do {
6060
let next = try await self.upstreamAsyncIterator?.next()
6161
await self.onNext(next)
62-
62+
6363
await self.gate.unlock()
64-
64+
6565
// yield allows to promote other tasks to resume, giving a chance to request a next element
6666
await Task.yield()
6767
} catch is CancellationError {

Sources/Operators/AsyncSequence+Multicast.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public extension AsyncSequence {
4444
/// // Stream 2 received: ("Third", 61)
4545
/// // Stream 1 received: ("Third", 61)
4646
/// ```
47-
/// In this example, the output shows that the upstream async sequence produces each random value only one time, and then sends the value to both client loops.
47+
/// In this example, the output shows that the upstream async sequence produces each random value only one time,
48+
/// and then sends the value to both client loops.
4849
///
4950
/// - Parameter stream: A `Stream` to deliver elements to downstream client loops.
5051
func multicast<S: Stream>(_ stream: S) -> AsyncMulticastSequence<Self, S> where S.Element == Element {
@@ -79,7 +80,7 @@ where UpstreamAsyncSequence.Element == DownstreamStream.Element {
7980

8081
/// Automates the process of connecting the multicasted async sequence.
8182
///
82-
///```
83+
/// ```
8384
/// let stream = AsyncStreams.Passthrough<(String, Int)>()
8485
/// let multicastedAsyncSequence = ["First", "Second", "Third"]
8586
/// .asyncElements

Sources/Operators/AsyncSequence+Share.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public extension AsyncSequence {
1010
///
1111
/// - Tip: ``share()`` is effectively a shortcut for ``multicast()`` using a ``Passthrough`` stream, with an implicit ``autoconnect()``.
1212
///
13-
/// The following example uses an async sequence as a counter to emit three random numbers. Each element is delayed by 1s to give the seconf loop a chance to
14-
/// catch all the values.
13+
/// The following example uses an async sequence as a counter to emit three random numbers.
14+
/// Each element is delayed by 1s to give the seconf loop a chance to catch all the values.
1515
///
1616
/// ```
1717
/// let sharedAsyncSequence = AsyncSequences.From(["first", "second", "third"], interval: .seconds(1))
@@ -40,7 +40,8 @@ public extension AsyncSequence {
4040
/// // Stream 2 received: ("Third", 61)
4141
/// // Stream 1 received: ("Third", 61)
4242
/// ```
43-
/// In this example, the output shows that the upstream async sequence produces each random value only one time, and then sends the value to both client loops.
43+
/// In this example, the output shows that the upstream async sequence produces each random value only one time,
44+
/// and then sends the value to both client loops.
4445
///
4546
/// Without the ``share()`` operator, loop 1 receives three random values, followed by loop 2 receiving three different random values.
4647
///
@@ -53,7 +54,6 @@ public extension AsyncSequence {
5354
}
5455
}
5556

56-
extension AsyncSequences {
57-
public typealias AsyncShareSequence<UpstreamAsyncSequence: AsyncSequence> =
58-
AsyncMulticastSequence<UpstreamAsyncSequence,AsyncStreams.Passthrough<UpstreamAsyncSequence.Element>>
57+
public extension AsyncSequences {
58+
typealias AsyncShareSequence<S: AsyncSequence> = AsyncMulticastSequence<S, AsyncStreams.Passthrough<S.Element>>
5959
}

0 commit comments

Comments
 (0)