Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/PIRProcessDatabase/ProcessDatabase.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -177,6 +177,7 @@ struct Arguments: Codable, Equatable, Hashable, Sendable {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(defaultArguments)
// swiftlint:disable:next optional_data_string_conversion
return String(decoding: data, as: UTF8.self)
}

Expand Down Expand Up @@ -240,6 +241,7 @@ struct ResolvedArguments: CustomStringConvertible, Encodable {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(self)
// swiftlint:disable:next optional_data_string_conversion
return String(decoding: data, as: UTF8.self)
}

Expand Down Expand Up @@ -453,6 +455,7 @@ extension ProcessKeywordDatabase.ShardValidationResult {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(descriptionDict)
// swiftlint:disable:next optional_data_string_conversion
let description = String(decoding: data, as: UTF8.self)
return description.replacingOccurrences(of: "\"", with: "")
}
Expand Down
5 changes: 4 additions & 1 deletion Sources/PNNSProcessDatabase/ProcessDatabase.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -105,6 +105,7 @@ struct Arguments: Codable, Equatable, Hashable, Sendable {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(defaultArguments)
// swiftlint:disable:next optional_data_string_conversion
return String(decoding: data, as: UTF8.self)
}

Expand Down Expand Up @@ -157,6 +158,7 @@ struct ResolvedArguments: CustomStringConvertible, Encodable {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(self)
// swiftlint:disable:next optional_data_string_conversion
return String(decoding: data, as: UTF8.self)
}

Expand Down Expand Up @@ -321,6 +323,7 @@ extension ValidationResult {
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
// swiftlint:disable:next force_try
let data = try! encoder.encode(descriptionDict)
// swiftlint:disable:next optional_data_string_conversion
let description = String(decoding: data, as: UTF8.self)
return description.replacingOccurrences(of: "\"", with: "")
}
Expand Down
Loading