File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -150,20 +150,15 @@ public struct SwiftPackageRegistryTool: ParsableCommand {
150150private extension Decodable {
151151 static func readFromJSONFile( in fileSystem: FileSystem , at path: AbsolutePath ) throws -> Self {
152152 let content = try fileSystem. readFileContents ( path)
153-
154- let decoder = JSONDecoder ( )
155-
153+ let decoder = JSONDecoder . makeWithDefaults ( )
156154 return try decoder. decode ( Self . self, from: Data ( content. contents) )
157155 }
158156}
159157
160158private extension Encodable {
161159 func writeToJSONFile( in fileSystem: FileSystem , at path: AbsolutePath ) throws {
162- let encoder = JSONEncoder ( )
163- encoder. outputFormatting = [ . sortedKeys, . prettyPrinted, . withoutEscapingSlashes]
164-
160+ let encoder = JSONEncoder . makeWithDefaults ( )
165161 let data = try encoder. encode ( self )
166-
167162 try fileSystem. writeFileContents ( path, bytes: ByteString ( data) , atomically: true )
168163 }
169164}
You can’t perform that action at this time.
0 commit comments