Skip to content

Commit e7639e4

Browse files
Format code
1 parent e466d85 commit e7639e4

11 files changed

+47
-47
lines changed

Fyreplace/Fakes/FakeClient.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ extension FakeClient {
9595
-> Operations.createEmail.Output
9696
{
9797
return switch input.body {
98-
case let .json(json) where json.email == Self.badEmail:
98+
case .json(let json) where json.email == Self.badEmail:
9999
.badRequest(.init(body: .json(.init())))
100100

101-
case let .json(json) where json.email == Self.usedEmail:
101+
case .json(let json) where json.email == Self.usedEmail:
102102
.conflict(.init(body: .json(.init())))
103103

104-
case let .json(json):
104+
case .json(let json):
105105
.created(
106106
.init(
107107
body: .json(
@@ -139,7 +139,7 @@ extension FakeClient {
139139
-> Operations.verifyEmail.Output
140140
{
141141
return switch input.body {
142-
case let .json(json) where json.code == Self.goodSecret:
142+
case .json(let json) where json.code == Self.goodSecret:
143143
.ok(.init())
144144

145145
case .json:
@@ -257,10 +257,10 @@ extension FakeClient {
257257
-> Operations.createNewToken.Output
258258
{
259259
return switch input.body {
260-
case let .json(json) where Self.goodIdentifers.contains(json.identifier):
260+
case .json(let json) where Self.goodIdentifers.contains(json.identifier):
261261
.ok(.init())
262262

263-
case let .json(json) where json.identifier == Self.passwordUsername:
263+
case .json(let json) where json.identifier == Self.passwordUsername:
264264
.forbidden(.init(body: .json(.init())))
265265

266266
case .json:
@@ -272,7 +272,7 @@ extension FakeClient {
272272
-> Operations.createToken.Output
273273
{
274274
return switch input.body {
275-
case let .json(json)
275+
case .json(let json)
276276
where Self.goodIdentifers.contains(json.identifier) && json.secret == Self.goodSecret:
277277
.created(.init(body: .plainText(.init(stringLiteral: Self.goodToken))))
278278

@@ -317,25 +317,25 @@ extension FakeClient {
317317
-> Operations.createUser.Output
318318
{
319319
return switch input.body {
320-
case let .json(json) where json.username == Self.badUsername:
320+
case .json(let json) where json.username == Self.badUsername:
321321
.badRequest(.init(body: .json(.init())))
322322

323-
case let .json(json) where json.username == Self.reservedUsername:
323+
case .json(let json) where json.username == Self.reservedUsername:
324324
.forbidden(.init(body: .json(.init())))
325325

326-
case let .json(json) where json.username == Self.usedUsername:
326+
case .json(let json) where json.username == Self.usedUsername:
327327
.conflict(.init(body: .json(.init())))
328328

329-
case let .json(json) where json.username == Self.passwordUsername:
329+
case .json(let json) where json.username == Self.passwordUsername:
330330
.forbidden(.init(body: .json(.init())))
331331

332-
case let .json(json) where json.email == Self.badEmail:
332+
case .json(let json) where json.email == Self.badEmail:
333333
.badRequest(.init(body: .json(.init())))
334334

335-
case let .json(json) where json.email == Self.usedEmail:
335+
case .json(let json) where json.email == Self.usedEmail:
336336
.conflict(.init(body: .json(.init())))
337337

338-
case let .json(json):
338+
case .json(let json):
339339
.created(.init(body: .json(.make(named: json.username))))
340340
}
341341
}
@@ -377,10 +377,10 @@ extension FakeClient {
377377
let largeImage = try await String(collecting: Self.largeImageBody, upTo: 64)
378378

379379
return switch input.body {
380-
case let .binary(binary) where try await String(collecting: binary, upTo: 64) == normalImage:
380+
case .binary(let binary) where try await String(collecting: binary, upTo: 64) == normalImage:
381381
.ok(.init(body: .plainText(.init(stringLiteral: Self.avatar))))
382382

383-
case let .binary(binary) where try await String(collecting: binary, upTo: 64) == largeImage:
383+
case .binary(let binary) where try await String(collecting: binary, upTo: 64) == largeImage:
384384
.contentTooLarge(.init())
385385

386386
case .binary:
@@ -392,7 +392,7 @@ extension FakeClient {
392392
-> Operations.setCurrentUserBio.Output
393393
{
394394
return switch input.body {
395-
case let .plainText(text):
395+
case .plainText(let text):
396396
.ok(.init(body: .plainText(text)))
397397
}
398398
}

Fyreplace/Views/MainViewProtocol.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ protocol MainViewProtocol: APIViewProtocol {
1717
extension MainViewProtocol {
1818
func handle(event: Event) {
1919
switch event {
20-
case let .error(description):
20+
case .error(let description):
2121
addError(.init(description: description))
2222

23-
case let .failure(title, text):
23+
case .failure(let title, let text):
2424
addFailure(.init(title: title, text: text))
2525

2626
case .authorizationIssue:
@@ -32,12 +32,12 @@ extension MainViewProtocol {
3232
)
3333
)
3434

35-
case let .emailVerification(email, randomCode):
35+
case .emailVerification(let email, let randomCode):
3636
Task {
3737
await verifyEmail(email: email, code: randomCode)
3838
}
3939

40-
case let .emailVerified(email):
40+
case .emailVerified(let email):
4141
verifiedEmail = email
4242
showEmailVerified = true
4343

@@ -79,9 +79,9 @@ extension MainViewProtocol {
7979
let response = try await api.getCurrentUser()
8080

8181
switch response {
82-
case let .ok(ok):
82+
case .ok(let ok):
8383
switch ok.body {
84-
case let .json(json):
84+
case .json(let json):
8585
currentUserId = json.id
8686
let user = User(userId: currentUserId)
8787
user.username = json.username

Fyreplace/Views/Navigation/RegularNavigation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct RegularNavigation: View, NavigationProtocol {
5454
.onReceive(eventBus.events) {
5555
guard isInForeground else { return }
5656

57-
if case let .navigationShortcut(destination) = $0 {
57+
if case .navigationShortcut(let destination) = $0 {
5858
selectedDestination = destination
5959
}
6060
}

Fyreplace/Views/Screens/EmailsScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct EmailsScreen: View, EmailsScreenProtocol {
124124
}
125125
}
126126
.onReceive(eventBus.events) {
127-
if case let .emailVerified(email) = $0 {
127+
if case .emailVerified(let email) = $0 {
128128
finishVerifyingEmail(email)
129129
}
130130
}

Fyreplace/Views/Screens/EmailsScreenProtocol.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ extension EmailsScreenProtocol {
3030
let response = try await api.listEmails(query: .init(page: page))
3131

3232
switch response {
33-
case let .ok(ok):
33+
case .ok(let ok):
3434
switch ok.body {
35-
case let .json(json):
35+
case .json(let json):
3636
hasMore = !json.isEmpty
3737
emails.append(contentsOf: json)
3838
}
@@ -65,9 +65,9 @@ extension EmailsScreenProtocol {
6565
let response = try await api.createEmail(body: .json(.init(email: newEmail)))
6666

6767
switch response {
68-
case let .created(created):
68+
case .created(let created):
6969
switch created.body {
70-
case let .json(json):
70+
case .json(let json):
7171
emails.append(json)
7272
}
7373

Fyreplace/Views/Screens/LoginScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct LoginScreen: View, LoginScreenProtocol {
9696
.onReceive(eventBus.events) {
9797
guard isWaitingForRandomCode else { return }
9898

99-
if case let .connection(code) = $0 {
99+
if case .connection(let code) = $0 {
100100
randomCode = code
101101
submit()
102102
}

Fyreplace/Views/Screens/LoginScreenProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ extension LoginScreenProtocol {
6161
)
6262

6363
switch response {
64-
case let .created(created):
64+
case .created(let created):
6565
switch created.body {
66-
case let .plainText(text):
66+
case .plainText(let text):
6767
token = try await .init(collecting: text, upTo: 1024)
6868
identifier = ""
6969
randomCode = ""

Fyreplace/Views/Screens/RegisterScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ struct RegisterScreen: View, RegisterScreenProtocol {
159159
.onReceive(eventBus.events) {
160160
guard isWaitingForRandomCode else { return }
161161

162-
if case let .connection(code) = $0 {
162+
if case .connection(let code) = $0 {
163163
randomCode = code
164164
submit()
165165
}

Fyreplace/Views/Screens/RegisterScreenProtocol.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ extension RegisterScreenProtocol {
4141
isRegistering = true
4242
return nil
4343

44-
case let .badRequest(badRequest):
44+
case .badRequest(let badRequest):
4545
switch badRequest.body {
46-
case let .json(json) where json.violations?.first?.field == "createUser.input.username":
46+
case .json(let json) where json.violations?.first?.field == "createUser.input.username":
4747
return .failure(
4848
title: "Register.Error.CreateUser.BadRequest.Username.Title",
4949
text: "Register.Error.CreateUser.BadRequest.Username.Message"
5050
)
5151

52-
case let .json(json) where json.violations?.first?.field == "createUser.input.email":
52+
case .json(let json) where json.violations?.first?.field == "createUser.input.email":
5353
return .failure(
5454
title: "Register.Error.CreateUser.BadRequest.Email.Title",
5555
text: "Register.Error.CreateUser.BadRequest.Email.Message"
@@ -68,9 +68,9 @@ extension RegisterScreenProtocol {
6868
text: "Register.Error.CreateUser.Forbidden.Message"
6969
)
7070

71-
case let .conflict(conflict):
71+
case .conflict(let conflict):
7272
switch conflict.body {
73-
case let .json(explanation) where explanation.reason == "username_taken":
73+
case .json(let explanation) where explanation.reason == "username_taken":
7474
return .failure(
7575
title: "Register.Error.CreateUser.Conflict.Username.Title",
7676
text: "Register.Error.CreateUser.Conflict.Username.Message"
@@ -94,9 +94,9 @@ extension RegisterScreenProtocol {
9494
)
9595

9696
switch response {
97-
case let .created(created):
97+
case .created(let created):
9898
switch created.body {
99-
case let .plainText(text):
99+
case .plainText(let text):
100100
token = try await .init(collecting: text, upTo: 1024)
101101
username = ""
102102
email = ""

Fyreplace/Views/Screens/SettingsScreenProtocol.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ extension SettingsScreenProtocol {
2020
let response = try await api.getCurrentUser()
2121

2222
switch response {
23-
case let .ok(ok):
23+
case .ok(let ok):
2424
switch ok.body {
25-
case let .json(user):
25+
case .json(let user):
2626
currentUser = user
2727
bio = user.bio
2828
}
@@ -46,9 +46,9 @@ extension SettingsScreenProtocol {
4646
let response = try await api.setCurrentUserAvatar(body: .binary(.init(data)))
4747

4848
switch response {
49-
case let .ok(ok):
49+
case .ok(let ok):
5050
switch ok.body {
51-
case let .plainText(text):
51+
case .plainText(let text):
5252
currentUser?.avatar = try await .init(collecting: text, upTo: 1024)
5353
}
5454

@@ -102,9 +102,9 @@ extension SettingsScreenProtocol {
102102
body: .plainText(bio.isEmpty ? .init() : .init(stringLiteral: bio)))
103103

104104
switch response {
105-
case let .ok(ok):
105+
case .ok(let ok):
106106
switch ok.body {
107-
case let .plainText(text):
107+
case .plainText(let text):
108108
bio = try await .init(
109109
collecting: text, upTo: Components.Schemas.User.maxBioSize * 4)
110110
currentUser?.bio = bio

0 commit comments

Comments
 (0)