Skip to content

Commit e3c19e6

Browse files
committed
Fix compilation when using Swift 5.8
1 parent 7da775c commit e3c19e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/JSONLogger.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,19 @@ extension JSONLogger {
228228
}
229229

230230
private func jsonMetadataValue(_ metadataValue: Logger.MetadataValue) -> JSON {
231-
return switch metadataValue {
232-
case let .string(s): .string(s)
233-
case let .array(array): .array (array .map (jsonMetadataValue(_:)))
234-
case let .dictionary(dictionary): .object(dictionary.mapValues(jsonMetadataValue(_:)))
231+
switch metadataValue {
232+
case let .string(s): return .string(s)
233+
case let .array(array): return .array (array .map (jsonMetadataValue(_:)))
234+
case let .dictionary(dictionary): return .object(dictionary.mapValues(jsonMetadataValue(_:)))
235235
case let .stringConvertible(s):
236236
if let (encoder, decoder) = jsonCodersForStringConvertibles,
237237
let c = s as? any Encodable,
238238
let data = try? encoder.encode(c),
239239
let json = try? decoder.decode(JSON.self, from: data)
240240
{
241-
json
241+
return json
242242
} else {
243-
.string(s.description)
243+
return .string(s.description)
244244
}
245245
}
246246

0 commit comments

Comments
 (0)