-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve conformance to Hashable and Equatable (#198)
- Loading branch information
Showing
16 changed files
with
251 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Sources/ParseCareKit/Extensions/OCKBiologicalSex+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// OCKBiologicalSex+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKBiologicalSex: @unchecked Sendable {} | ||
|
||
extension OCKBiologicalSex: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(self) | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
Sources/ParseCareKit/Extensions/OCKContactCategory+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// OCKContactCategory+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKContactCategory: @unchecked Sendable {} |
21 changes: 21 additions & 0 deletions
21
Sources/ParseCareKit/Extensions/OCKLabeledValue+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// OCKLabeledValue+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKLabeledValue: @unchecked Sendable {} | ||
|
||
extension OCKLabeledValue: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(label) | ||
hasher.combine(value) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// OCKNote+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKNote: @unchecked Sendable {} | ||
|
||
extension OCKNote: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(author) | ||
hasher.combine(title) | ||
hasher.combine(content) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// OCKOutcomeValue.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKOutcomeValue: @unchecked Sendable {} | ||
|
||
extension OCKOutcomeValue: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(kind) | ||
hasher.combine(units) | ||
hasher.combine(createdDate) | ||
hasher.combine(integerValue) | ||
hasher.combine(doubleValue) | ||
hasher.combine(booleanValue) | ||
hasher.combine(stringValue) | ||
hasher.combine(dataValue) | ||
hasher.combine(dateValue) | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
Sources/ParseCareKit/Extensions/OCKPostalAddress+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// OCKPostalAddress+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKPostalAddress: @unchecked Sendable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// OCKSchedule+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKSchedule: @unchecked Sendable {} | ||
|
||
extension OCKSchedule: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(elements) | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
Sources/ParseCareKit/Extensions/OCKScheduleElement+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// OCKScheduleElement+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKScheduleElement: @unchecked Sendable {} | ||
|
||
extension OCKScheduleElement.Duration: Hashable { | ||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(self) | ||
} | ||
} | ||
|
||
extension OCKScheduleElement: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(text) | ||
hasher.combine(duration) | ||
hasher.combine(start) | ||
hasher.combine(end) | ||
hasher.combine(interval) | ||
hasher.combine(targetValues) | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
Sources/ParseCareKit/Extensions/OCKSemanticVersion+Parse.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// OCKSemanticVersion+Parse.swift | ||
// ParseCareKit | ||
// | ||
// Created by Corey Baker on 7/13/24. | ||
// Copyright © 2024 Network Reconnaissance Lab. All rights reserved. | ||
// | ||
|
||
import CareKitStore | ||
import Foundation | ||
|
||
extension OCKSemanticVersion: @unchecked Sendable {} | ||
|
||
extension OCKSemanticVersion: Hashable { | ||
|
||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(majorVersion) | ||
hasher.combine(minorVersion) | ||
hasher.combine(patchNumber) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters