Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
juri committed Dec 6, 2024
1 parent 337cd2f commit 79eff19
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Sources/ProvisionInfoKit/Certificate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct Certificate: Codable, Sendable {

extension Certificate {
/// Initialize a `Certificate` with the data of a `DeveloperCertificates` array entry.
public init(data: Data) throws (ProvisionInfoError) {
public init(data: Data) throws(ProvisionInfoError) {
guard let cert = SecCertificateCreateWithData(nil, data as CFData) else {
throw ProvisionInfoError.certificateReadFailure
}
Expand Down
16 changes: 8 additions & 8 deletions Sources/ProvisionInfoKit/Entitlements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public enum EntitlementValue: Equatable, Sendable {
}

extension EntitlementValue {
static func make(from value: Any) throws (ProvisionInfoError) -> EntitlementValue {
static func make(from value: Any) throws(ProvisionInfoError) -> EntitlementValue {
fatalError()
}

init(value: Any) throws (ProvisionInfoError) {
init(value: Any) throws(ProvisionInfoError) {
switch value {
case let array as [Any]:
let decodedValues = try array.map { entry throws (ProvisionInfoError) in
let decodedValues = try array.map { entry throws(ProvisionInfoError) in
try EntitlementValue(value: entry)
}
self = .array(decodedValues)
Expand Down Expand Up @@ -51,7 +51,7 @@ extension EntitlementValue {
}
}

init(dict: [String: Any]) throws (ProvisionInfoError) {
init(dict: [String: Any]) throws(ProvisionInfoError) {
self = try .dictionary(EntitlementsDictionary(dict: dict))
}
}
Expand Down Expand Up @@ -168,11 +168,11 @@ extension EntitlementValue: Decodable {
public typealias EntitlementsDictionary = [String: EntitlementValue]

extension EntitlementsDictionary {
package init(dict: [String: Any]) throws (ProvisionInfoError) {
let mapped = try dict.map { key, value throws (ProvisionInfoError) in
return (key, try EntitlementValue(value: value))
package init(dict: [String: Any]) throws(ProvisionInfoError) {
let mapped = try dict.map { key, value throws(ProvisionInfoError) in
return try (key, EntitlementValue(value: value))
}
self = Dictionary.init(uniqueKeysWithValues: mapped)
self = Dictionary(uniqueKeysWithValues: mapped)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/ProvisionInfoKit/Profile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public struct Profile: Codable, Sendable {

extension Profile {
/// Initialize a `Profile` with a `Data`.
public init(data: Data) throws (ProvisionInfoError) {
public init(data: Data) throws(ProvisionInfoError) {
let raw = try RawProfile(data: data)
try self.init(raw: raw)
}

/// Initializes a `Profile` with a `RawProfile`.
public init(raw: RawProfile) throws (ProvisionInfoError) {
public init(raw: RawProfile) throws(ProvisionInfoError) {
let creationDate = raw.fields["CreationDate"] as? Date
let derEncodedProfile = raw.fields["DER-Encoded-Profile"] as? Data
let developerCertificates = raw.fields["DeveloperCertificates"] as? [Data] ?? []
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProvisionInfoKit/RawProfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ public struct RawProfile {

extension RawProfile {
/// Initializes a `RawProfile` with data of a provisioning profile file.
public init(data: Data) throws (ProvisionInfoError) {
public init(data: Data) throws(ProvisionInfoError) {
let decoded = try decodeProfile(data: data)
self.init(fields: decoded)
}
}

func decodeProfile(data: Data) throws (ProvisionInfoError) -> [String: Any] {
func decodeProfile(data: Data) throws(ProvisionInfoError) -> [String: Any] {
var decoder: CMSDecoder?
var status: OSStatus = errSecSuccess

Expand Down

0 comments on commit 79eff19

Please sign in to comment.