Skip to content

Commit 73ad411

Browse files
committed
formatting
1 parent b6f252c commit 73ad411

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Sources/DistributedCluster/DistributedProgress/DistributedProgress.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
2929

3030
func to(step: Steps) async throws {
3131
// TODO: checks that we don't move backwards...
32-
log.notice("Move to step: \(step)")
32+
self.log.notice("Move to step: \(step)")
3333
self.step = step
3434

35-
for sub in subscribers {
35+
for sub in self.subscribers {
3636
try await sub.currentStep(step)
3737
}
3838

@@ -108,7 +108,7 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
108108
return
109109
}
110110

111-
try await ensureSubscription()
111+
try await self.ensureSubscription()
112112

113113
await withCheckedContinuation { (cc: CheckedContinuation<Void, Never>) in
114114
self._completedCC = cc
@@ -121,7 +121,7 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
121121
return nil // last step was already emitted
122122
}
123123

124-
try await ensureSubscription()
124+
try await self.ensureSubscription()
125125

126126
return await withCheckedContinuation { (cc: CheckedContinuation<Steps, Never>) in
127127
self._nextCC = cc
@@ -168,7 +168,6 @@ public distributed actor DistributedProgress<Steps: DistributedProgressSteps> {
168168
// MARK: Progress AsyncSequence
169169

170170
extension DistributedProgress.Box {
171-
172171
public func steps(file: String = #file, line: UInt = #line) async throws -> DistributedProgressAsyncSequence<Steps> {
173172
try await self.ensureSubscription()
174173

@@ -198,7 +197,7 @@ public struct DistributedProgressAsyncSequence<Steps: DistributedProgressSteps>:
198197
}
199198

200199
public func next() async throws -> Steps? {
201-
try await box.nextStep()
200+
try await self.box.nextStep()
202201
}
203202
}
204203
}
@@ -210,6 +209,7 @@ public protocol DistributedProgressSteps: Codable, Sendable, Equatable, CaseIter
210209
static var count: Int { get }
211210
static var last: Self { get }
212211
}
212+
213213
extension DistributedProgressSteps {
214214
public static var count: Int {
215215
precondition(count > 0, "\(Self.self) cannot have zero steps (cases)!")
@@ -222,4 +222,4 @@ extension DistributedProgressSteps {
222222
}
223223
return last
224224
}
225-
}
225+
}

Tests/DistributedClusterTests/DistributedProgressTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ distributed actor BuildWatcher: CustomStringConvertible {
8181
let progress = try await self.builder.build()
8282

8383
try await progress.completed()
84-
probe.tell("completed")
84+
self.probe.tell("completed")
8585
}
8686

8787
distributed func runBuild_streamSteps() async throws {
8888
let progress = try await self.builder.build()
8989

9090
for try await step in try await progress.steps() {
91-
probe.tell("received-step:\(step)")
91+
self.probe.tell("received-step:\(step)")
9292
}
9393
}
9494

0 commit comments

Comments
 (0)