Skip to content

Commit bca641c

Browse files
committed
Remove comment and rearrange extensions
1 parent 6ef846c commit bca641c

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

ios/MullvadREST/Relay/LocationIdentifier.swift

+11-14
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ extension REST.LocationIdentifier: RawRepresentable {
2929
}
3030
}
3131

32-
// ExpressibleByStringLiteral: this allows literal assignments, like
33-
// foo.location = "se-gbg"
34-
// saving space in test code and such.
3532
extension REST.LocationIdentifier: ExpressibleByStringLiteral {
3633
public init(stringLiteral value: StringLiteralType) {
3734
guard let parsed = Self.parse(value) else {
@@ -44,17 +41,6 @@ extension REST.LocationIdentifier: ExpressibleByStringLiteral {
4441
}
4542
}
4643

47-
// As the location's values are Substrings of the same String, to which they maintain references, we use the base String for holistic operations such as equality and hashing
48-
extension REST.LocationIdentifier: Hashable {
49-
public static func == (lhs: REST.LocationIdentifier, rhs: REST.LocationIdentifier) -> Bool {
50-
lhs.rawValue == rhs.rawValue
51-
}
52-
53-
public func hash(into hasher: inout Hasher) {
54-
hasher.combine(rawValue)
55-
}
56-
}
57-
5844
// Allow LocationIdentifier to code to/from JSON Strings
5945
extension REST.LocationIdentifier: Codable {
6046
enum ParsingError: Error {
@@ -74,3 +60,14 @@ extension REST.LocationIdentifier: Codable {
7460
try container.encode(rawValue)
7561
}
7662
}
63+
64+
// As the location's values are Substrings of the same String, to which they maintain references, we use the base String for holistic operations such as equality and hashing
65+
extension REST.LocationIdentifier: Hashable {
66+
public static func == (lhs: REST.LocationIdentifier, rhs: REST.LocationIdentifier) -> Bool {
67+
lhs.rawValue == rhs.rawValue
68+
}
69+
70+
public func hash(into hasher: inout Hasher) {
71+
hasher.combine(rawValue)
72+
}
73+
}

0 commit comments

Comments
 (0)