Skip to content

Commit

Permalink
Merge pull request #32 from outfoxx/fix/type-check
Browse files Browse the repository at this point in the history
Fix type checking failure with 5.4
  • Loading branch information
kdubb authored Jan 18, 2023
2 parents 484b42c + 3e4bb60 commit 2221bcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/PotentCodables/Dates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public struct SuffixedDateFormatter {

public func date(from string: String) -> ZonedDate? {
let parsedDate: Date?
let zoneStartIndex = string.firstIndex { $0 == "-" || $0 == "+" || $0 == "Z" } ?? string.endIndex
let zoneStartIndex = string.firstIndex { (ch: Character) in ch == "-" || ch == "+" || ch == "Z" } ?? string.endIndex
let stringWithoutZone = String(string[string.startIndex ..< zoneStartIndex])
let hasZone = string != stringWithoutZone
if checkHasSeconds(stringWithoutZone) && hasZone {
Expand Down

0 comments on commit 2221bcb

Please sign in to comment.