Use interpolation instead of concatination to create JSON.string description

This commit is contained in:
Caleb Kleveter 2019-03-21 11:54:54 -05:00
parent a1fd5b660f
commit 81a2e658fc
No known key found for this signature in database
GPG Key ID: B38DBD5CF2C98D69
1 changed files with 1 additions and 1 deletions

View File

@ -408,7 +408,7 @@ public enum JSON: Equatable, CustomStringConvertible {
public var description: String {
switch self {
case .null: return "null"
case let .string(string): return "\"" + string + "\""
case let .string(string): return #""\#(string)""#
case let .number(number): return number.description
case let .bool(bool): return bool.description
case let .array(array): return "[" + array.map { $0.description }.joined(separator: ",") + "]"