Skip to content

Commit 366d31b

Browse files
committed
Use checked Sendable for async observer
1 parent b77cea5 commit 366d31b

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PersistentKeyValueKit is backed by a robust test suite.
6161

6262
```swift
6363
dependencies: [
64-
.package(url: "https://github.com/kylehughes/PersistentKeyValueKit.git", .upToNextMajor(from: "1.1.0")),
64+
.package(url: "https://github.com/kylehughes/PersistentKeyValueKit.git", .upToNextMajor(from: "1.2.1")),
6565
]
6666
```
6767

Sources/PersistentKeyValueKit/Async Sequence/PersistentKeyValues.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,9 @@ extension PersistentKeyValues {
148148
///
149149
/// - SeeAlso: ``PersistentKeyValueStore`` for thread-safety requirements.
150150
/// - SeeAlso: https://forums.swift.org/t/crash-when-running-in-swift-6-language-mode/72431/2
151-
/// - Important: This type is manually `Sendable` because `PersistentKeyValueStore` cannot require `Sendable`
152-
/// conformance from `UserDefaults` or `NSUbiquitousKeyValueStore`. Access to mutable observer state is protected by
153-
/// `state`, and conforming stores are required to be thread-safe.
154-
private final class Observer<Key>: NSObject, @unchecked Sendable where Key: PersistentKeyProtocol {
151+
/// - Important: Access to mutable observer state is protected by `state`, and conforming stores are required to be
152+
/// thread-safe.
153+
private final class Observer<Key>: NSObject, Sendable where Key: PersistentKeyProtocol {
155154
private let key: Key
156155
private let keyID: String
157156
private let state: State

0 commit comments

Comments
 (0)