Skip to content

Commit 91a4721

Browse files
committed
remove unneeded availability check
1 parent bf390f1 commit 91a4721

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Sources/AWSLambdaEvents/Utils/DateWrappers.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ public struct ISO8601Coding: Decodable, Sendable {
4343

4444
private static func parseISO8601(dateString: String) -> Date? {
4545
#if canImport(FoundationEssentials)
46-
if #available(macOS 12.0, *) {
47-
return try? Date(dateString, strategy: .iso8601)
48-
} else {
49-
return Self.dateFormatter.date(from: dateString)
50-
}
46+
return try? Date(dateString, strategy: .iso8601)
5147
#else
5248
return Self.dateFormatter.date(from: dateString)
5349
#endif
@@ -89,11 +85,7 @@ public struct ISO8601WithFractionalSecondsCoding: Decodable, Sendable {
8985

9086
private static func parseISO8601WithFractionalSeconds(dateString: String) -> Date? {
9187
#if canImport(FoundationEssentials)
92-
if #available(macOS 12.0, *) {
93-
return try? Date(dateString, strategy: Self.iso8601WithFractionalSeconds)
94-
} else {
95-
return Self.dateFormatter.date(from: dateString)
96-
}
88+
return try? Date(dateString, strategy: Self.iso8601WithFractionalSeconds)
9789
#else
9890
return Self.dateFormatter.date(from: dateString)
9991
#endif

0 commit comments

Comments
 (0)