Skip to content

Commit

Permalink
Renamed DateTimeCoding to RFC5322DateTimeCoding
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Jun 17, 2020
1 parent e7eea00 commit 18c129d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/AWSLambdaEvents/SES.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public enum SES {
public struct CommonHeaders: Decodable {
public let bcc: [String]?
public let cc: [String]?
@DateTimeCoding public var date: Date
@RFC5322DateTimeCoding public var date: Date
public let from: [String]
public let messageId: String
public let returnPath: String?
Expand Down
4 changes: 2 additions & 2 deletions Sources/AWSLambdaEvents/Utils/DateWrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct ISO8601WithFractionalSecondsCoding: Decodable {
}

@propertyWrapper
public struct DateTimeCoding: Decodable {
public struct RFC5322DateTimeCoding: Decodable {
public let wrappedValue: Date

public init(wrappedValue: Date) {
Expand All @@ -83,7 +83,7 @@ public struct DateTimeCoding: Decodable {
let dateString = try container.decode(String.self)
guard let date = Self.dateFormatter.date(from: dateString) else {
throw DecodingError.dataCorruptedError(in: container, debugDescription:
"Expected date to be in date-time format with fractional seconds, but `\(dateString)` does not forfill format")
"Expected date to be in RFC5322 date-time format with fractional seconds, but `\(dateString)` does not forfill format")
}
self.wrappedValue = date
}
Expand Down

0 comments on commit 18c129d

Please sign in to comment.