Skip to content

Commit 8ffc4e8

Browse files
committed
Remove toRFC*() methods in favor of init pattern
Removed toRFC1035() and toRFC1123() transformation methods. Added init patterns for bidirectional conversion: RFC_1123.Domain(rfc1035Domain) RFC_1035.Domain(rfc1123Domain) This provides a cleaner, more idiomatic API for cross-RFC conversions.
1 parent a958110 commit 8ffc4e8

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Sources/RFC_1123/RFC 1123.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,12 @@ extension Domain: RawRepresentable {
221221

222222
extension RFC_1123.Domain {
223223
public init(_ domain: RFC_1035.Domain) throws {
224-
self = try RFC_1123.Domain(domain.name)
225-
}
226-
227-
public func toRFC1035() throws -> RFC_1035.Domain {
228-
try RFC_1035.Domain(self.name)
224+
try self.init(domain.name)
229225
}
230226
}
231227

232228
extension RFC_1035.Domain {
233229
public init(_ domain: RFC_1123.Domain) throws {
234230
try self.init(domain.name)
235231
}
236-
237-
public func toRFC1123() throws -> RFC_1123.Domain {
238-
try RFC_1123.Domain(self.name)
239-
}
240232
}

0 commit comments

Comments
 (0)