Skip to content

Commit ae7db4f

Browse files
committed
Update RFC 5322 implementation and tests
1 parent 1ac4497 commit ae7db4f

16 files changed

+654
-352
lines changed

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:6.0
1+
// swift-tools-version:6.2
22

33
import PackageDescription
44

@@ -14,7 +14,7 @@ extension Target.Dependency {
1414
static var rfc5322Foundation: Self { .target(name: .rfc5322Foundation) }
1515
static var rfc1123: Self { .product(name: "RFC_1123", package: "swift-rfc-1123") }
1616
static var standards: Self { .product(name: "Standards", package: "swift-standards") }
17-
static var incits_4_1986: Self { .product(name: "INCITS_4_1986", package: "swift-incits-4-1986") }
17+
static var incits_4_1986: Self { .product(name: "INCITS 4 1986", package: "swift-incits-4-1986") }
1818
static var standardsTestSupport: Self { .product(name: "StandardsTestSupport", package: "swift-standards") }
1919
}
2020

@@ -32,8 +32,8 @@ let package = Package(
3232
],
3333
dependencies: [
3434
.package(url: "https://github.com/swift-standards/swift-rfc-1123.git", from: "0.0.1"),
35-
.package(url: "https://github.com/swift-standards/swift-standards.git", from: "0.1.0"),
36-
.package(url: "https://github.com/swift-standards/swift-incits-4-1986.git", from: "0.1.0")
35+
.package(url: "https://github.com/swift-standards/swift-standards.git", from: "0.0.1"),
36+
.package(url: "https://github.com/swift-standards/swift-incits-4-1986.git", from: "0.0.1")
3737
],
3838
targets: [
3939
.target(

Sources/RFC_5322/RFC_5322.Date.Components.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,31 @@ extension RFC_5322.Date {
6868
self.weekday = weekday
6969
}
7070

71+
/// Creates date components without validation (internal use only)
72+
///
73+
/// This initializer bypasses validation and should only be used when component values
74+
/// are known to be valid (e.g., computed from epoch seconds).
75+
///
76+
/// - Warning: Using this with invalid values will create an invalid Components instance.
77+
/// Only use when values are guaranteed valid by construction.
78+
internal init(
79+
uncheckedYear year: Int,
80+
month: Int,
81+
day: Int,
82+
hour: Int,
83+
minute: Int,
84+
second: Int,
85+
weekday: Int
86+
) {
87+
self.year = year
88+
self.month = month
89+
self.day = day
90+
self.hour = hour
91+
self.minute = minute
92+
self.second = second
93+
self.weekday = weekday
94+
}
95+
7196
/// Returns the number of days in the given month for the given year
7297
private static func daysInMonth(_ month: Int, year: Int) -> Int {
7398
switch month {

0 commit comments

Comments
 (0)