summaryrefslogtreecommitdiff
path: root/Hutch/Models/ContributionCalendar.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-08-07 17:41:00 -0500
committerGitHub <[email protected]>2026-08-07 17:41:00 -0500
commitff200d21e93d6683f779fe1f3280ac8d8561d393 (patch)
treef6603518ba62134faa699d864003b90464930ab9 /Hutch/Models/ContributionCalendar.swift
parent9d85bc7c154843693913bf0cc67c6e9ff0d8f897 (diff)
parent283fbf00fdffd64c924b6cb22c84e803b718f078 (diff)
downloadhutch-ff200d21e93d6683f779fe1f3280ac8d8561d393.tar.gz
hutch-ff200d21e93d6683f779fe1f3280ac8d8561d393.tar.bz2
hutch-ff200d21e93d6683f779fe1f3280ac8d8561d393.zip
Merge pull request #39 from krazywarez/fix-actor-isolationHEADmain
Adopt Swift 6 language mode
Diffstat (limited to 'Hutch/Models/ContributionCalendar.swift')
-rw-r--r--Hutch/Models/ContributionCalendar.swift28
1 files changed, 14 insertions, 14 deletions
diff --git a/Hutch/Models/ContributionCalendar.swift b/Hutch/Models/ContributionCalendar.swift
index a429fa2..cf87ca7 100644
--- a/Hutch/Models/ContributionCalendar.swift
+++ b/Hutch/Models/ContributionCalendar.swift
@@ -1,6 +1,6 @@
import Foundation
-struct ContributionCalendarResponse: Decodable, Sendable, Hashable {
+nonisolated struct ContributionCalendarResponse: Decodable, Sendable, Hashable {
let actor: String
let from: Date
let to: Date
@@ -9,7 +9,7 @@ struct ContributionCalendarResponse: Decodable, Sendable, Hashable {
let indexingState: ContributionIndexingState
let days: [ContributionDay]
- enum CodingKeys: String, CodingKey {
+ nonisolated enum CodingKeys: String, CodingKey {
case actor
case from
case to
@@ -59,14 +59,14 @@ struct ContributionCalendarResponse: Decodable, Sendable, Hashable {
}
}
-struct ContributionDay: Decodable, Sendable, Hashable, Identifiable {
+nonisolated struct ContributionDay: Decodable, Sendable, Hashable, Identifiable {
var id: Date { date }
let date: Date
let count: Int
let score: Double
- enum CodingKeys: String, CodingKey {
+ nonisolated enum CodingKeys: String, CodingKey {
case date
case count
case score
@@ -90,7 +90,7 @@ struct ContributionDay: Decodable, Sendable, Hashable, Identifiable {
}
}
-struct ContributionStatsResponse: Decodable, Sendable, Hashable {
+nonisolated struct ContributionStatsResponse: Decodable, Sendable, Hashable {
let actor: String
let from: Date
let to: Date
@@ -103,7 +103,7 @@ struct ContributionStatsResponse: Decodable, Sendable, Hashable {
let longestStreak: Int
let currentStreak: Int
- enum CodingKeys: String, CodingKey {
+ nonisolated enum CodingKeys: String, CodingKey {
case actor
case from
case to
@@ -117,7 +117,7 @@ struct ContributionStatsResponse: Decodable, Sendable, Hashable {
case currentStreak = "current_streak"
}
- struct StatsWindow: Sendable, Hashable {
+ nonisolated struct StatsWindow: Sendable, Hashable {
let actor: String
let from: Date
let to: Date
@@ -126,7 +126,7 @@ struct ContributionStatsResponse: Decodable, Sendable, Hashable {
let indexingState: ContributionIndexingState
}
- struct StatsTotals: Sendable, Hashable {
+ nonisolated struct StatsTotals: Sendable, Hashable {
let totalEvents: Int
let totalScore: Double
let activeDays: Int
@@ -181,13 +181,13 @@ struct ContributionStatsResponse: Decodable, Sendable, Hashable {
}
}
-enum ContributionIndexingState: String, Codable, Sendable, Hashable {
+nonisolated enum ContributionIndexingState: String, Codable, Sendable, Hashable {
case pending
case indexed
case error
}
-enum ContributionIntensity: Int, Sendable, CaseIterable {
+nonisolated enum ContributionIntensity: Int, Sendable, CaseIterable {
case empty = 0
case level1 = 1
case level2 = 2
@@ -210,12 +210,12 @@ enum ContributionIntensity: Int, Sendable, CaseIterable {
}
}
-struct ContributionWeek: Sendable, Hashable {
+nonisolated struct ContributionWeek: Sendable, Hashable {
let startDate: Date
let days: [ContributionDay]
}
-enum ContributionCalendarLayout {
+nonisolated enum ContributionCalendarLayout {
static func weekColumns(
from days: [ContributionDay],
calendar: Calendar = .contributionCalendar
@@ -241,7 +241,7 @@ enum ContributionCalendarLayout {
}
}
-enum ContributionDateParser {
+nonisolated enum ContributionDateParser {
static func parse(_ rawValue: String) -> Date? {
let parts = rawValue.split(separator: "-", omittingEmptySubsequences: false)
guard
@@ -348,7 +348,7 @@ enum ContributionDateParser {
}
}
-extension Calendar {
+nonisolated extension Calendar {
static var contributionCalendar: Calendar {
var calendar = Calendar(identifier: .gregorian)
calendar.firstWeekday = 1