Skip to content

Commit

Permalink
Improve compatibility with strict concurrency
Browse files Browse the repository at this point in the history
Fixes #167
  • Loading branch information
sindresorhus committed Feb 20, 2024
1 parent adc090e commit 38925e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Defaults/Defaults.swift
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Sources/Defaults/Observation.swift
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -365,3 +365,4 @@ extension Defaults.ObservationOptions {
}

extension Defaults.KeyChange: Equatable where Value: Equatable {}
extension Defaults.KeyChange: Sendable where Value: Sendable {}

0 comments on commit 38925e3

Please sign in to comment.