feat: Conforming types to Sendable

This commit is contained in:
2024-06-11 07:46:47 -04:00
parent 2e42f3a0e2
commit e07df0e426
11 changed files with 47 additions and 35 deletions

View File

@@ -4,8 +4,8 @@ import Foundation
/// on the current value.
///
@dynamicMemberLookup
public struct Flagged: Equatable {
public struct Flagged: Equatable, Sendable {
public var checkValue: CheckHandler
public var wrappedValue: Double
@@ -51,11 +51,11 @@ public struct Flagged: Equatable {
}
}
public struct CheckHandler {
let checkValue: (Double) -> CheckResult
public init(_ checkValue: @escaping (Double) -> CheckResult) {
public struct CheckHandler: Sendable {
let checkValue: @Sendable (Double) -> CheckResult
public init(_ checkValue: @escaping @Sendable (Double) -> CheckResult) {
self.checkValue = checkValue
}
@@ -64,8 +64,8 @@ public struct Flagged: Equatable {
}
}
public enum CheckResult: Equatable {
public enum CheckResult: Equatable, Sendable {
case aboveMaximum(Double)
case belowMinimum(Double)
case betweenRange(minimum: Double, maximum: Double)
@@ -113,7 +113,7 @@ public struct Flagged: Equatable {
}
}
public enum Status: String, Equatable, CaseIterable {
public enum Status: String, Equatable, CaseIterable, Sendable {
case good, warning, error
public var title: String {