Skip to content

Commit 5e6f6b8

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent ba0e8d8 commit 5e6f6b8

File tree

11 files changed

+148
-137
lines changed

11 files changed

+148
-137
lines changed

Examples/CaseStudies/UIKit/WiFiFeature/WiFiSettingsFeature.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ class WiFiSettingsViewController: UICollectionViewController, UIKitCaseStudy {
155155
)
156156
]
157157

158-
case let .selectedNetwork(networkID):
158+
case .selectedNetwork(let networkID):
159159
guard let network = model.foundNetworks.first(where: { $0.id == networkID })
160160
else { return }
161161
configureNetwork(cell: cell, network: network, indexPath: indexPath, item: item)
162162

163-
case let .foundNetwork(network):
163+
case .foundNetwork(let network):
164164
configureNetwork(cell: cell, network: network, indexPath: indexPath, item: item)
165165
}
166166

Examples/Inventory/ItemRow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ struct ItemRowView: View {
8787
.font(.title3)
8888

8989
switch model.item.status {
90-
case let .inStock(quantity):
90+
case .inStock(let quantity):
9191
Text("In stock: \(quantity)")
92-
case let .outOfStock(isOnBackOrder):
92+
case .outOfStock(let isOnBackOrder):
9393
Text("Out of stock\(isOnBackOrder ? ": on back order" : "")")
9494
}
9595
}

Sources/AppKitNavigation/AppKitAnimation.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
completion: ((Bool?) -> Void)? = nil
4141
) rethrows -> Result {
4242
switch framework {
43-
case let .appKit(animation):
43+
case .appKit(let animation):
4444
var result: Swift.Result<Result, Error>?
4545
NSAnimationContext.runAnimationGroup { context in
4646
context.allowsImplicitAnimation = true
@@ -52,7 +52,7 @@
5252
}
5353
return try result!._rethrowGet()
5454

55-
case let .swiftUI(animation):
55+
case .swiftUI(let animation):
5656
var result: Swift.Result<Result, Error>?
5757
#if swift(>=6)
5858
if #available(macOS 15, *) {
@@ -92,11 +92,11 @@
9292
_ speed: Double
9393
) -> Self {
9494
switch framework {
95-
case let .swiftUI(animation):
95+
case .swiftUI(let animation):
9696
return AppKitAnimation(
9797
framework: .swiftUI(animation.speed(speed))
9898
)
99-
case var .appKit(animation):
99+
case .appKit(var animation):
100100
if speed != 0 {
101101
animation.speed = speed
102102
} else {

Sources/SwiftNavigation/ButtonState.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public struct ButtonState<Action>: Identifiable {
6161
/// `withAnimation`.
6262
public func withAction(_ perform: (Action?) -> Void) {
6363
switch self.action.type {
64-
case let .send(action):
64+
case .send(let action):
6565
perform(action)
6666
#if canImport(SwiftUI)
67-
case let .animatedSend(action, animation):
67+
case .animatedSend(let action, let animation):
6868
withAnimation(animation) {
6969
perform(action)
7070
}
@@ -81,10 +81,10 @@ public struct ButtonState<Action>: Identifiable {
8181
@MainActor
8282
public func withAction(_ perform: @MainActor (Action?) async -> Void) async {
8383
switch self.action.type {
84-
case let .send(action):
84+
case .send(let action):
8585
await perform(action)
8686
#if canImport(SwiftUI)
87-
case let .animatedSend(action, _):
87+
case .animatedSend(let action, _):
8888
var output = ""
8989
customDump(self.action, to: &output, indent: 4)
9090
reportIssue(
@@ -135,10 +135,10 @@ public struct ButtonStateAction<Action> {
135135
public var action: Action? {
136136
switch self.type {
137137
#if canImport(SwiftUI)
138-
case let .animatedSend(action, animation: _):
138+
case .animatedSend(let action, animation: _):
139139
return action
140140
#endif
141-
case let .send(action):
141+
case .send(let action):
142142
return action
143143
}
144144
}
@@ -148,10 +148,10 @@ public struct ButtonStateAction<Action> {
148148
) -> ButtonStateAction<NewAction> {
149149
switch self.type {
150150
#if canImport(SwiftUI)
151-
case let .animatedSend(action, animation: animation):
151+
case .animatedSend(let action, animation: let animation):
152152
return .send(transform(action), animation: animation)
153153
#endif
154-
case let .send(action):
154+
case .send(let action):
155155
return .send(transform(action))
156156
}
157157
}
@@ -198,7 +198,7 @@ extension ButtonState: CustomDumpReflectable {
198198
extension ButtonStateAction: CustomDumpReflectable {
199199
public var customDumpMirror: Mirror {
200200
switch self.type {
201-
case let .send(action):
201+
case .send(let action):
202202
return Mirror(
203203
self,
204204
children: [
@@ -207,7 +207,7 @@ extension ButtonStateAction: CustomDumpReflectable {
207207
displayStyle: .enum
208208
)
209209
#if canImport(SwiftUI)
210-
case let .animatedSend(action, animation):
210+
case .animatedSend(let action, let animation):
211211
return Mirror(
212212
self,
213213
children: [
@@ -236,10 +236,10 @@ extension ButtonStateAction._ActionType: Hashable where Action: Hashable {
236236
public func hash(into hasher: inout Hasher) {
237237
switch self {
238238
#if canImport(SwiftUI)
239-
case let .animatedSend(action, animation: _):
239+
case .animatedSend(let action, animation: _):
240240
hasher.combine(action) // TODO: Should we hash the animation?
241241
#endif
242-
case let .send(action):
242+
case .send(let action):
243243
hasher.combine(action)
244244
}
245245
}

Sources/SwiftNavigation/Observe.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ import ConcurrencyExtras
8787

8888
func _observe(
8989
_ apply: @escaping @Sendable (_ transaction: UITransaction) -> Void,
90-
task: @escaping @Sendable (
91-
_ transaction: UITransaction, _ operation: @escaping @Sendable () -> Void
92-
) -> Void = {
93-
Task(operation: $1)
94-
}
90+
task:
91+
@escaping @Sendable (
92+
_ transaction: UITransaction, _ operation: @escaping @Sendable () -> Void
93+
) -> Void = {
94+
Task(operation: $1)
95+
}
9596
) -> ObserveToken {
9697
let token = ObserveToken()
9798
onChange(
@@ -123,9 +124,10 @@ func _observe(
123124

124125
private func onChange(
125126
_ apply: @escaping @Sendable (_ transaction: UITransaction) -> Void,
126-
task: @escaping @Sendable (
127-
_ transaction: UITransaction, _ operation: @escaping @isolated(any) @Sendable () -> Void
128-
) -> Void
127+
task:
128+
@escaping @Sendable (
129+
_ transaction: UITransaction, _ operation: @escaping @isolated(any) @Sendable () -> Void
130+
) -> Void
129131
) {
130132
withPerceptionTracking {
131133
apply(.current)

0 commit comments

Comments
 (0)