Skip to content

Commit e0d7a23

Browse files
committed
Remove unnecessary RFC 5321 dependency
Removed unused RFC_5321 dependency from both: - Package.swift (dependency declaration) - RFC 5322.swift (import statement) RFC 5322 doesn't use any RFC 5321 types. Cross-RFC conversions (RFC_5322 ↔ RFC_5321) are now provided by swift-emailaddress-type to avoid circular dependencies. This improves package independence and follows the principle that each RFC package should be as self-contained as possible.
1 parent ed1bbde commit e0d7a23

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Package.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ extension String {
1010
extension Target.Dependency {
1111
static var rfc5322: Self { .target(name: .rfc5322) }
1212
static var rfc1123: Self { .product(name: "RFC_1123", package: "swift-rfc-1123") }
13-
static var rfc5321: Self { .product(name: "RFC_5321", package: "swift-rfc-5321") }
1413
}
1514

1615
let package = Package(
@@ -24,14 +23,12 @@ let package = Package(
2423
],
2524
dependencies: [
2625
.package(url: "https://github.com/swift-standards/swift-rfc-1123.git", from: "0.0.1"),
27-
.package(url: "https://github.com/swift-standards/swift-rfc-5321.git", from: "0.0.1"),
2826
],
2927
targets: [
3028
.target(
3129
name: .rfc5322,
3230
dependencies: [
33-
.rfc1123,
34-
.rfc5321
31+
.rfc1123
3532
]
3633
),
3734
.testTarget(

Sources/RFC_5322/RFC 5322.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import Foundation
99
import RFC_1123
10-
import RFC_5321
1110
import RegexBuilder
1211

1312
public enum RFC_5322 {}
@@ -195,15 +194,6 @@ extension RFC_5322.EmailAddress {
195194
public var addressValue: String {
196195
"\(localPart.stringValue)@\(domain.name)"
197196
}
198-
199-
/// Convert to RFC 5321 format if possible
200-
public func toRFC5321() throws -> RFC_5321.EmailAddress {
201-
try RFC_5321.EmailAddress(
202-
displayName: displayName,
203-
localPart: .init(localPart.stringValue),
204-
domain: domain
205-
)
206-
}
207197
}
208198

209199
// MARK: - Errors

0 commit comments

Comments
 (0)