aboutsummaryrefslogtreecommitdiff
path: root/HoloBar/CharacterFetcher.swift
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-04-23 02:31:49 -0700
committerFuwn <[email protected]>2025-04-23 02:31:49 -0700
commit138be808e577fcda97f32018988cc9cc90b3f452 (patch)
treeb52f78ecbc57928022b0b6f9884b9fec4d965a56 /HoloBar/CharacterFetcher.swift
parentstyle: Format all source files (diff)
downloadholobar-138be808e577fcda97f32018988cc9cc90b3f452.tar.xz
holobar-138be808e577fcda97f32018988cc9cc90b3f452.zip
refactor: Apply lintsHEADmain
Diffstat (limited to 'HoloBar/CharacterFetcher.swift')
-rw-r--r--HoloBar/CharacterFetcher.swift11
1 files changed, 4 insertions, 7 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 }