Skip to content

Commit 3ef38bb

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent 1c07db9 commit 3ef38bb

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Sources/Dependencies/WithDependencies.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,29 +66,29 @@ public func withDependencies<R>(
6666
operation: () async throws -> R
6767
) async rethrows -> R {
6868
#if DEBUG
69-
try await DependencyValues.$isSetting.withValue(true) {
70-
var dependencies = DependencyValues._current
71-
try await updateValuesForOperation(&dependencies)
72-
return try await DependencyValues.$_current.withValue(dependencies) {
73-
try await DependencyValues.$isSetting.withValue(false) {
74-
let result = try await operation()
75-
if R.self is AnyClass {
76-
dependencyObjects.store(result as AnyObject)
69+
try await DependencyValues.$isSetting.withValue(true) {
70+
var dependencies = DependencyValues._current
71+
try await updateValuesForOperation(&dependencies)
72+
return try await DependencyValues.$_current.withValue(dependencies) {
73+
try await DependencyValues.$isSetting.withValue(false) {
74+
let result = try await operation()
75+
if R.self is AnyClass {
76+
dependencyObjects.store(result as AnyObject)
77+
}
78+
return result
7779
}
78-
return result
7980
}
8081
}
81-
}
8282
#else
83-
var dependencies = DependencyValues._current
84-
try await updateValuesForOperation(&dependencies)
85-
return try await DependencyValues.$_current.withValue(dependencies) {
86-
let result = try await operation()
87-
if R.self is AnyClass {
88-
dependencyObjects.store(result as AnyObject)
83+
var dependencies = DependencyValues._current
84+
try await updateValuesForOperation(&dependencies)
85+
return try await DependencyValues.$_current.withValue(dependencies) {
86+
let result = try await operation()
87+
if R.self is AnyClass {
88+
dependencyObjects.store(result as AnyObject)
89+
}
90+
return result
8991
}
90-
return result
91-
}
9292
#endif
9393
}
9494
#else
@@ -483,11 +483,11 @@ private func isSetting<R>(
483483
_ value: Bool,
484484
operation: () throws -> R
485485
) rethrows -> R {
486-
#if DEBUG
487-
try DependencyValues.$isSetting.withValue(value, operation: operation)
488-
#else
489-
try operation()
490-
#endif
486+
#if DEBUG
487+
try DependencyValues.$isSetting.withValue(value, operation: operation)
488+
#else
489+
try operation()
490+
#endif
491491
}
492492

493493
#if swift(<6)

0 commit comments

Comments
 (0)