Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nbhasin2 committed Sep 21, 2024
1 parent a0a12e9 commit 05551a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ enum RemoteDataType: String, Codable {
if let decodedArray = try? JSONDecoder().decode([T].self, from: data) {
return decodedArray
}

let singleObject = try JSONDecoder().decode(T.self, from: data)
return [singleObject]
} catch {
print("Error: Failed to decode '\(fileName).json'. Error: \(error.localizedDescription)")
throw RemoteDataTypeError.decodingError(fileName: fileName, error: error)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RemoteSettingsUtilities {
self.logger = logger
}

func fetchLocalRecord<T: RemoteDataTypeRecord>(for type: RemoteDataType) async -> [T]? {
func fetchLocalRecords<T: RemoteDataTypeRecord>(for type: RemoteDataType) async -> [T]? {
do {
let records: [T] = try await type.loadLocalSettingsFromJSON()
return records
Expand Down

0 comments on commit 05551a2

Please sign in to comment.