|
5 | 5 | // EmailAddress implementation |
6 | 6 | // |
7 | 7 |
|
8 | | -import Standards |
9 | 8 | import INCITS_4_1986 |
10 | 9 | public import RFC_1123 |
| 10 | +import Standards |
11 | 11 |
|
12 | 12 | extension RFC_5321 { |
13 | 13 | /// RFC 5321 compliant email address (basic SMTP format) |
@@ -75,22 +75,6 @@ extension RFC_5321 { |
75 | 75 | } |
76 | 76 | } |
77 | 77 |
|
78 | | -//// MARK: - Convenience Initializers |
79 | | -// |
80 | | -//extension RFC_5321.EmailAddress { |
81 | | -// /// Initialize from string representation ("Name <local@domain>" or "local@domain") |
82 | | -// /// |
83 | | -// /// Convenience initializer that converts String to bytes and delegates to byte parser. |
84 | | -// /// |
85 | | -// /// String parsing is derived composition: |
86 | | -// /// ``` |
87 | | -// /// String → [UInt8] (UTF-8) → EmailAddress |
88 | | -// /// ``` |
89 | | -// public init(_ string: some StringProtocol) throws(Error) { |
90 | | -// try self.init(ascii: Array(string.utf8)) |
91 | | -// } |
92 | | -//} |
93 | | - |
94 | 78 | // MARK: - Byte-Level Parsing (UInt8.ASCII.Serializable) |
95 | 79 |
|
96 | 80 | extension RFC_5321.EmailAddress: UInt8.ASCII.Serializable { |
@@ -124,8 +108,8 @@ extension RFC_5321.EmailAddress: UInt8.ASCII.Serializable { |
124 | 108 | guard !bytes.isEmpty else { throw Error.missingAtSign } |
125 | 109 |
|
126 | 110 | // Check for angle bracket format: [display-name] <local@domain> |
127 | | - if let openAngle = bytes.firstIndex(where: { $0 == 0x3C }), // < |
128 | | - let closeAngle = bytes.firstIndex(where: { $0 == 0x3E }) { // > |
| 111 | + if let openAngle = bytes.firstIndex(where: { $0 == 0x3C }), // < |
| 112 | + let closeAngle = bytes.firstIndex(where: { $0 == 0x3E }) { // > |
129 | 113 |
|
130 | 114 | // Extract display name if present |
131 | 115 | let displayName: String? |
@@ -271,4 +255,4 @@ extension RFC_5321.EmailAddress { |
271 | 255 | } |
272 | 256 |
|
273 | 257 | // MARK: - Protocol Conformances |
274 | | -extension RFC_5321.EmailAddress: CustomStringConvertible { } |
| 258 | +extension RFC_5321.EmailAddress: CustomStringConvertible {} |
0 commit comments