Improve compatibility with strict concurrency

Fixes #167
This commit is contained in:
Sindre Sorhus 2024-02-20 19:32:27 +07:00
parent adc090e939
commit 38925e3cfa
2 changed files with 3 additions and 2 deletions

View File

@ -43,7 +43,7 @@ extension Defaults {
/**
Type-erased key.
*/
public class _AnyKey {
public class _AnyKey: @unchecked Sendable {
public typealias Key = Defaults.Key
public let name: String

View File

@ -27,7 +27,7 @@ public protocol _DefaultsObservation: AnyObject {
extension Defaults {
public typealias Observation = _DefaultsObservation
public enum ObservationOption {
public enum ObservationOption: Sendable {
/**
Whether a notification should be sent to the observer immediately, before the observer registration method even returns.
*/
@ -365,3 +365,4 @@ extension Defaults.ObservationOptions {
}
extension Defaults.KeyChange: Equatable where Value: Equatable {}
extension Defaults.KeyChange: Sendable where Value: Sendable {}