-
Notifications
You must be signed in to change notification settings - Fork 465
fix: Add more Hashable conformance #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ import Foundation | |
| /// A store that allows for reading tasks. | ||
| public protocol OCKReadableTaskStore: OCKAnyReadOnlyTaskStore { | ||
|
|
||
| associatedtype Task: OCKAnyTask, Equatable | ||
| associatedtype Task: OCKAnyTask, Hashable | ||
|
|
||
|
Comment on lines
35
to
37
|
||
| /// An asynchronous sequence that produces tasks. | ||
| associatedtype Tasks: AsyncSequence & Sendable where Tasks.Element == [Task] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,9 +35,9 @@ import Foundation | |
| /// The event contains a copy of the task itself, the | ||
| /// schedule event, and an outcome that's non-`nil` if progress is made on the task. | ||
| public struct OCKEvent< | ||
| Task: OCKAnyTask & Equatable, | ||
| Outcome: OCKAnyOutcome & Equatable | ||
| >: Identifiable, Comparable, Sendable { | ||
| Task: OCKAnyTask & Hashable, | ||
| Outcome: OCKAnyOutcome & Hashable | ||
| >: Identifiable, Hashable, Comparable, Sendable { | ||
|
Comment on lines
37
to
+40
|
||
|
|
||
|
Comment on lines
37
to
41
|
||
| /// The stable identifier to use. | ||
| public let id: String | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing
OCKReadableOutcomeStore.OutcomefromEquatabletoHashableis a source-breaking change for external outcome store implementations that only providedEquatableoutcomes. If avoiding breaking changes is important, consider leaving this protocol as-is and adding a new/refinement protocol that requiresHashable(or awhere Outcome: Hashableconstrained extension) for SwiftUI-facing APIs.