Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 21, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@

import Foundation

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct StringRule: @unchecked Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct StringRule: Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var minLength: Int?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var maxLength: Int?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var pattern: String?
}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct NumericRule<T: Comparable & Numeric>: @unchecked Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct NumericRule<T: Comparable & Numeric> {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var minimum: T?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var exclusiveMinimum = false
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var maximum: T?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var exclusiveMaximum = false
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var multipleOf: T?
}
extension NumericRule: Sendable where T: Sendable {}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ArrayRule: @unchecked Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct ArrayRule: Sendable {
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var minItems: Int?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var maxItems: Int?
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var uniqueItems: Bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@

import Foundation

internal struct StringRule: @unchecked Sendable {
internal struct StringRule: Sendable {
internal var minLength: Int?
internal var maxLength: Int?
internal var pattern: String?
}

internal struct NumericRule<T: Comparable & Numeric>: @unchecked Sendable {
internal struct NumericRule<T: Comparable & Numeric> {
internal var minimum: T?
internal var exclusiveMinimum = false
internal var maximum: T?
internal var exclusiveMaximum = false
internal var multipleOf: T?
}
extension NumericRule: Sendable where T: Sendable {}

internal struct ArrayRule: @unchecked Sendable {
internal struct ArrayRule: Sendable {
internal var minItems: Int?
internal var maxItems: Int?
internal var uniqueItems: Bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading