mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Fix Swift 6 warnings (#1513)
This commit is contained in:
@@ -13,14 +13,15 @@ extension Dictionary where Key: JSONKey {
|
||||
let keys = Array(dictionary.keys)
|
||||
var itemResults: [Result<T, Error>] = Array(repeating: .failure(defaultError), count: keys.count)
|
||||
itemResults.withUnsafeMutableBufferPointer { buffer in
|
||||
let bufferWrapper = BufferWrapper(buffer: buffer)
|
||||
DispatchQueue.concurrentPerform(iterations: dictionary.count) { idx in
|
||||
do {
|
||||
let key = keys[idx]
|
||||
let jsonDictionary: JSONDictionary = try dictionary.json(atKeyPath: .key(key))
|
||||
let item = try T(name: key, jsonDictionary: jsonDictionary)
|
||||
buffer[idx] = .success(item)
|
||||
bufferWrapper.buffer[idx] = .success(item)
|
||||
} catch {
|
||||
buffer[idx] = .failure(error)
|
||||
bufferWrapper.buffer[idx] = .failure(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,6 +50,14 @@ extension Dictionary where Key: JSONKey {
|
||||
}
|
||||
}
|
||||
|
||||
private final class BufferWrapper<T>: @unchecked Sendable {
|
||||
var buffer: UnsafeMutableBufferPointer<T>
|
||||
|
||||
init(buffer: UnsafeMutableBufferPointer<T>) {
|
||||
self.buffer = buffer
|
||||
}
|
||||
}
|
||||
|
||||
public protocol NamedJSONDictionaryConvertible {
|
||||
|
||||
init(name: String, jsonDictionary: JSONDictionary) throws
|
||||
|
||||
@@ -878,7 +878,7 @@ extension Scheme.Build: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension BuildType: JSONPrimitiveConvertible {
|
||||
extension BuildType: JSONUtilities.JSONPrimitiveConvertible {
|
||||
|
||||
public typealias JSONType = String
|
||||
|
||||
@@ -910,7 +910,7 @@ extension BuildType: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension XCScheme.EnvironmentVariable: JSONObjectConvertible {
|
||||
extension XCScheme.EnvironmentVariable: JSONUtilities.JSONObjectConvertible {
|
||||
public static let enabledDefault = true
|
||||
|
||||
private static func parseValue(_ value: Any) -> String {
|
||||
|
||||
@@ -101,7 +101,7 @@ extension SwiftPackage: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension SwiftPackage.VersionRequirement: JSONObjectConvertible {
|
||||
extension SwiftPackage.VersionRequirement: JSONUtilities.JSONObjectConvertible {
|
||||
|
||||
public init(jsonDictionary: JSONDictionary) throws {
|
||||
if jsonDictionary["exactVersion"] != nil {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
import Version
|
||||
|
||||
extension Version: ExpressibleByStringLiteral {
|
||||
extension Version: Swift.ExpressibleByStringLiteral {
|
||||
|
||||
public static func parse(_ string: String) throws -> Version {
|
||||
if let version = Version(tolerant: string) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import Foundation
|
||||
import PathKit
|
||||
import SwiftCLI
|
||||
|
||||
extension Path: ConvertibleFromString {
|
||||
extension Path: SwiftCLI.ConvertibleFromString {
|
||||
|
||||
public init?(input: String) {
|
||||
self.init(input)
|
||||
|
||||
@@ -73,7 +73,7 @@ struct CarthageVersionFile: Decodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Platform: CodingKey {
|
||||
extension Platform: Swift.CodingKey {
|
||||
|
||||
public var stringValue: String {
|
||||
carthageName
|
||||
|
||||
Reference in New Issue
Block a user