[swift6] Add checked Sendable conformance to Validation structs (#20150)

This commit is contained in:
Lennard Sprong
2024-11-21 12:23:54 +01:00
committed by GitHub
parent c06db15750
commit 2b891f6da9
15 changed files with 60 additions and 45 deletions

View File

@@ -6,21 +6,22 @@
import Foundation
public struct StringRule: @unchecked Sendable {
public struct StringRule: Sendable {
public var minLength: Int?
public var maxLength: Int?
public var pattern: String?
}
public struct NumericRule<T: Comparable & Numeric>: @unchecked Sendable {
public struct NumericRule<T: Comparable & Numeric> {
public var minimum: T?
public var exclusiveMinimum = false
public var maximum: T?
public var exclusiveMaximum = false
public var multipleOf: T?
}
extension NumericRule: Sendable where T: Sendable {}
public struct ArrayRule: @unchecked Sendable {
public struct ArrayRule: Sendable {
public var minItems: Int?
public var maxItems: Int?
public var uniqueItems: Bool