Skip to content

Commit 654a54a

Browse files
committed
Apply swift-format to stats detail screens
Formatting-only pass produced by the repository's swift-format hook on ReferrerStatsView, ExternalLinkStatsView, and ArchiveStatsView, committed separately to keep the subsequent change reviewable.
1 parent f9eeef2 commit 654a54a

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

Modules/Sources/JetpackStats/Screens/ArchiveStatsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct ArchiveStatsView: View {
7575
}
7676

7777
private var itemsChartData: TopListData {
78-
return TopListData(
78+
TopListData(
7979
item: .archive,
8080
metric: .views,
8181
items: archiveSection.items

Modules/Sources/JetpackStats/Screens/ExternalLinkStatsView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ struct ExternalLinkStatsView: View {
6666
@ViewBuilder
6767
var linkIcon: some View {
6868
if let url = URL(string: externalLink.url),
69-
let host = url.host,
70-
let iconURL = URL(string: "https://www.google.com/s2/favicons?domain=\(host)&sz=128") {
69+
let host = url.host,
70+
let iconURL = URL(string: "https://www.google.com/s2/favicons?domain=\(host)&sz=128")
71+
{
7172
CachedAsyncImage(url: iconURL) { image in
7273
image
7374
.resizable()
@@ -131,7 +132,7 @@ struct ExternalLinkStatsView: View {
131132
}
132133

133134
private var childrenChartData: TopListData {
134-
return TopListData(
135+
TopListData(
135136
item: .externalLinks,
136137
metric: .views,
137138
items: externalLink.children

Modules/Sources/JetpackStats/Screens/ReferrerStatsView.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct ReferrerStatsView: View {
3939
.navigationTitle(Strings.ReferrerDetails.title)
4040
.navigationBarTitleDisplayMode(.inline)
4141
.alert(Strings.ReferrerDetails.errorAlertTitle, isPresented: $showErrorAlert) {
42-
Button(Strings.Buttons.ok, role: .cancel) { }
42+
Button(Strings.Buttons.ok, role: .cancel) {}
4343
} message: {
4444
Text(errorMessage)
4545
}
@@ -66,7 +66,7 @@ struct ReferrerStatsView: View {
6666
await markAsSpam()
6767
}
6868
}
69-
Button(Strings.Buttons.cancel, role: .cancel) { }
69+
Button(Strings.Buttons.cancel, role: .cancel) {}
7070
} message: {
7171
Text(Strings.ReferrerDetails.confirmAsSpamMessage(domain: referrer.domain ?? ""))
7272
}
@@ -170,7 +170,7 @@ struct ReferrerStatsView: View {
170170
}
171171

172172
private var childrenChartData: TopListData {
173-
return TopListData(
173+
TopListData(
174174
item: .referrers,
175175
metric: .views,
176176
items: referrer.children
@@ -187,7 +187,9 @@ struct ReferrerStatsView: View {
187187
// Update local state to reflect the change
188188
isMarkedAsSpam = true
189189
} catch {
190-
errorMessage = error.localizedDescription.isEmpty ? Strings.ReferrerDetails.markAsSpamError : error.localizedDescription
190+
errorMessage =
191+
error.localizedDescription.isEmpty
192+
? Strings.ReferrerDetails.markAsSpamError : error.localizedDescription
191193
showErrorAlert = true
192194
}
193195

0 commit comments

Comments
 (0)