Skip to content

Commit

Permalink
@unchecked Sendable
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Jun 22, 2024
1 parent 2b6973d commit 1c6a36b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Sources/Ananda/AnandaValueExtractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public struct AnandaValueExtractor: Sendable {
}

#if os(Linux)
extension ISO8601DateFormatter {
extension ISO8601DateFormatter: @unchecked Sendable {
public static func ananda_date(from string: String) -> Date? {
if let date = ananda_iso8601A.date(from: string) {
return date
Expand All @@ -137,7 +137,7 @@ extension ISO8601DateFormatter {
return nil
}

private nonisolated(unsafe) static let ananda_iso8601A: ISO8601DateFormatter = {
private static let ananda_iso8601A: ISO8601DateFormatter = {
let dateFormatter = ISO8601DateFormatter()

dateFormatter.formatOptions = [
Expand All @@ -148,7 +148,7 @@ extension ISO8601DateFormatter {
return dateFormatter
}()

private nonisolated(unsafe) static let ananda_iso8601B: ISO8601DateFormatter = {
private static let ananda_iso8601B: ISO8601DateFormatter = {
let dateFormatter = ISO8601DateFormatter()

dateFormatter.formatOptions = [
Expand All @@ -159,7 +159,7 @@ extension ISO8601DateFormatter {
}()
}
#else
extension JJLISO8601DateFormatter {
extension JJLISO8601DateFormatter: @unchecked Sendable {
public static func ananda_date(from string: String) -> Date? {
if let date = ananda_iso8601A.date(from: string) {
return date
Expand All @@ -172,7 +172,7 @@ extension JJLISO8601DateFormatter {
return nil
}

private nonisolated(unsafe) static let ananda_iso8601A: JJLISO8601DateFormatter = {
private static let ananda_iso8601A: JJLISO8601DateFormatter = {
let dateFormatter = JJLISO8601DateFormatter()

dateFormatter.formatOptions = [
Expand All @@ -183,7 +183,7 @@ extension JJLISO8601DateFormatter {
return dateFormatter
}()

private nonisolated(unsafe) static let ananda_iso8601B: JJLISO8601DateFormatter = {
private static let ananda_iso8601B: JJLISO8601DateFormatter = {
let dateFormatter = JJLISO8601DateFormatter()

dateFormatter.formatOptions = [
Expand All @@ -195,8 +195,8 @@ extension JJLISO8601DateFormatter {
}
#endif

extension CharacterSet {
public nonisolated(unsafe) static let ananda_url: Self = {
extension CharacterSet: @unchecked Sendable {
public static let ananda_url: Self = {
var set = CharacterSet.urlQueryAllowed
set.insert("#")
set.formUnion(.urlPathAllowed)
Expand Down

0 comments on commit 1c6a36b

Please sign in to comment.