aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HoloBar/CharacterFetcher.swift11
-rw-r--r--HoloBar/HoloBarApp.swift2
2 files changed, 5 insertions, 8 deletions
diff --git a/HoloBar/CharacterFetcher.swift b/HoloBar/CharacterFetcher.swift
index ff5a059..44ad443 100644
--- a/HoloBar/CharacterFetcher.swift
+++ b/HoloBar/CharacterFetcher.swift
@@ -13,12 +13,12 @@ class CharacterFetcher: ObservableObject {
}
func fetchCharacters(for month: Int, day: Int) {
- let urlString =
+ let urlString = // swiftlint:disable:next line_length
"https://hololist.net/birthday/?birthday_month=\(String(format: "%02d", month))&birthday_day=\(String(format: "%02d", day))"
guard let url = URL(string: urlString) else { return }
let task = URLSession.shared.dataTask(with: url) { data, _, error in
- guard let data = data, error == nil,
+ guard let data, error == nil,
let html = String(data: data, encoding: .utf8)
else { return }
@@ -82,13 +82,10 @@ class CharacterFetcher: ObservableObject {
for character in characters {
group.enter()
- let task = URLSession.shared.dataTask(with: character.profileURL) {
- data,
- _,
- error in
+ let task = URLSession.shared.dataTask(with: character.profileURL) { data, _, error in
defer { group.leave() }
- guard let data = data,
+ guard let data,
error == nil,
let html = String(data: data, encoding: .utf8)
else { return }
diff --git a/HoloBar/HoloBarApp.swift b/HoloBar/HoloBarApp.swift
index 650495b..699d135 100644
--- a/HoloBar/HoloBarApp.swift
+++ b/HoloBar/HoloBarApp.swift
@@ -55,7 +55,7 @@ struct HoloBarApp: App {
}
Button("Refresh", action: refreshCharacters)
- Button("Quit", action: { NSApplication.shared.terminate(nil) })
+ Button("Quit") { NSApplication.shared.terminate(nil) }
}
.onReceive(NotificationCenter.default.publisher(for: .NSCalendarDayChanged)) { _ in
refreshCharacters()