Skip to content

Commit 38c01f3

Browse files
committed
Rename _convert -> convert
1 parent c000573 commit 38c01f3

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Sources/XMLCoder/Encoder/XMLChoiceEncodingContainer.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
3434

3535
// MARK: - Coding Path Operations
3636

37-
private func _converted(_ key: CodingKey) -> CodingKey {
37+
private func converted(_ key: CodingKey) -> CodingKey {
3838
switch encoder.options.keyEncodingStrategy {
3939
case .useDefaultKeys:
4040
return key
@@ -67,7 +67,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
6767

6868
public mutating func encodeNil(forKey key: Key) throws {
6969
container.withShared {
70-
$0.key = _converted(key).stringValue
70+
$0.key = converted(key).stringValue
7171
$0.element = NullBox()
7272
}
7373
}
@@ -102,7 +102,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
102102
let elementEncoder: (T, Key, Box) throws -> () = { _, key, box in
103103
mySelf.container.withShared { container in
104104
container.element = box
105-
container.key = mySelf._converted(key).stringValue
105+
container.key = mySelf.converted(key).stringValue
106106
}
107107
}
108108

@@ -132,7 +132,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
132132

133133
self.container.withShared { container in
134134
container.element = sharedKeyed
135-
container.key = _converted(key).stringValue
135+
container.key = converted(key).stringValue
136136
}
137137

138138
codingPath.append(key)
@@ -154,7 +154,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
154154

155155
self.container.withShared { container in
156156
container.element = sharedChoice
157-
container.key = _converted(key).stringValue
157+
container.key = converted(key).stringValue
158158
}
159159

160160
codingPath.append(key)
@@ -175,7 +175,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
175175

176176
container.withShared { container in
177177
container.element = sharedUnkeyed
178-
container.key = _converted(key).stringValue
178+
container.key = converted(key).stringValue
179179
}
180180

181181
codingPath.append(key)
@@ -191,7 +191,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
191191
return XMLReferencingEncoder(
192192
referencing: encoder,
193193
key: XMLKey.super,
194-
convertedKey: _converted(XMLKey.super),
194+
convertedKey: converted(XMLKey.super),
195195
wrapping: container
196196
)
197197
}
@@ -200,7 +200,7 @@ struct XMLChoiceEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol
200200
return XMLReferencingEncoder(
201201
referencing: encoder,
202202
key: key,
203-
convertedKey: _converted(key),
203+
convertedKey: converted(key),
204204
wrapping: container
205205
)
206206
}

Sources/XMLCoder/Encoder/XMLKeyedEncodingContainer.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
3636

3737
// MARK: - Coding Path Operations
3838

39-
private func _converted(_ key: CodingKey) -> CodingKey {
39+
private func converted(_ key: CodingKey) -> CodingKey {
4040
switch encoder.options.keyEncodingStrategy {
4141
case .useDefaultKeys:
4242
return key
@@ -69,7 +69,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
6969

7070
public mutating func encodeNil(forKey key: Key) throws {
7171
container.withShared {
72-
$0.elements.append(NullBox(), at: _converted(key).stringValue)
72+
$0.elements.append(NullBox(), at: converted(key).stringValue)
7373
}
7474
}
7575

@@ -113,13 +113,13 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
113113
))
114114
}
115115
mySelf.container.withShared { container in
116-
container.attributes.append(attribute, at: mySelf._converted(key).stringValue)
116+
container.attributes.append(attribute, at: mySelf.converted(key).stringValue)
117117
}
118118
}
119119

120120
let elementEncoder: (T, Key, Box) throws -> () = { _, key, box in
121121
mySelf.container.withShared { container in
122-
container.elements.append(box, at: mySelf._converted(key).stringValue)
122+
container.elements.append(box, at: mySelf.converted(key).stringValue)
123123
}
124124
}
125125

@@ -156,7 +156,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
156156
let sharedKeyed = SharedBox(KeyedBox())
157157

158158
self.container.withShared { container in
159-
container.elements.append(sharedKeyed, at: _converted(key).stringValue)
159+
container.elements.append(sharedKeyed, at: converted(key).stringValue)
160160
}
161161

162162
codingPath.append(key)
@@ -177,7 +177,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
177177
let sharedChoice = SharedBox(ChoiceBox())
178178

179179
self.container.withShared { container in
180-
container.elements.append(sharedChoice, at: _converted(key).stringValue)
180+
container.elements.append(sharedChoice, at: converted(key).stringValue)
181181
}
182182

183183
codingPath.append(key)
@@ -197,7 +197,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
197197
let sharedUnkeyed = SharedBox(UnkeyedBox())
198198

199199
container.withShared { container in
200-
container.elements.append(sharedUnkeyed, at: _converted(key).stringValue)
200+
container.elements.append(sharedUnkeyed, at: converted(key).stringValue)
201201
}
202202

203203
codingPath.append(key)
@@ -213,7 +213,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
213213
return XMLReferencingEncoder(
214214
referencing: encoder,
215215
key: XMLKey.super,
216-
convertedKey: _converted(XMLKey.super),
216+
convertedKey: converted(XMLKey.super),
217217
wrapping: container
218218
)
219219
}
@@ -222,7 +222,7 @@ struct XMLKeyedEncodingContainer<K: CodingKey>: KeyedEncodingContainerProtocol {
222222
return XMLReferencingEncoder(
223223
referencing: encoder,
224224
key: key,
225-
convertedKey: _converted(key),
225+
convertedKey: converted(key),
226226
wrapping: container
227227
)
228228
}

0 commit comments

Comments
 (0)