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 {
150
150
private extension Decodable {
151
151
static func readFromJSONFile( in fileSystem: FileSystem , at path: AbsolutePath ) throws -> Self {
152
152
let content = try fileSystem. readFileContents ( path)
153
-
154
- let decoder = JSONDecoder ( )
155
-
153
+ let decoder = JSONDecoder . makeWithDefaults ( )
156
154
return try decoder. decode ( Self . self, from: Data ( content. contents) )
157
155
}
158
156
}
159
157
160
158
private extension Encodable {
161
159
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 ( )
165
161
let data = try encoder. encode ( self )
166
-
167
162
try fileSystem. writeFileContents ( path, bytes: ByteString ( data) , atomically: true )
168
163
}
169
164
}
You can’t perform that action at this time.
0 commit comments