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
15 changes: 12 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -10,7 +10,16 @@ let package = Package(
.library(name: "ValidationKit", targets: ["ValidationKit"]),
],
targets: [
.target(name: "ValidationKit", dependencies: [], resources: [.process("Resources")]),
.testTarget(name: "ValidationKitTests", dependencies: ["ValidationKit"]),
.target(
name: "ValidationKit",
resources: [.process("Resources")],
swiftSettings: [
.enableUpcomingFeature("StrictConcurrency")
]
),
.testTarget(
name: "ValidationKitTests",
dependencies: ["ValidationKit"]
),
]
)
2 changes: 1 addition & 1 deletion Sources/ValidationKit/ValidationError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

/// An error that occurs when input validation does not pass.
public struct ValidationError: Error, LocalizedError, Equatable, Hashable {
public struct ValidationError: Error, LocalizedError, Equatable, Hashable, Sendable {
public let localizedDescription: String
public var errorDescription: String? {
localizedDescription
Expand Down
2 changes: 2 additions & 0 deletions Sources/ValidationKit/ValidationResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum ValidationResult<Value> {
case invalid(ValidationError)
}

extension ValidationResult: Sendable where Value: Sendable {}

public extension ValidationResult {
/// The validation error, or nil if the value is valid
var error: ValidationError? {
Expand Down