Undo equatable bindings due to complexity
All checks were successful
Deploy Docs / publish (push) Successful in 45s
SwiftLint / SwiftLint (push) Successful in 2s

This commit is contained in:
david-swift 2024-10-20 14:02:32 +02:00
parent 99603193b9
commit a8ce63a67f

View File

@ -65,8 +65,6 @@ public struct Binding<Value> {
/// The closure for getting the value.
private let getValue: () -> Value
/// The cached value for comparison purposes.
private let value: Value
/// The closure for settings the value.
private let setValue: (Value) -> Void
/// Handlers observing whether the binding changes.
@ -89,7 +87,6 @@ public struct Binding<Value> {
/// - set: The closure for setting the value.
public init(get: @escaping () -> Value, set: @escaping (Value) -> Void) {
self.getValue = get
self.value = get()
self.setValue = set
}
@ -115,18 +112,6 @@ public struct Binding<Value> {
}
extension Binding: Equatable where Value: Equatable {
/// Whether two binding values were equal when they were initialized.
/// - Parameters:
/// - lhs: The first binding.
/// - rhs: The second binding.
public static func == (lhs: Self, rhs: Self) -> Bool {
lhs.value == rhs.value
}
}
/// Extend bindings.
extension Binding where Value: MutableCollection {