mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
Fix KeyPathRefining for compiler(<5.1)
This commit is contained in:
1 parent
349e34b1c1
commit
9dcd0b8f42
1 file changed
+9
@@ -20,6 +20,15 @@ extension KeyPathRefining {
|
||||
return result
|
||||
}
|
||||
|
||||
#if compiler(<5.1)
|
||||
@inlinable
|
||||
func with<T>(_ keyPath: WritableKeyPath<Self, T?>, _ value: T) -> Self {
|
||||
var result = self
|
||||
result[keyPath: keyPath] = value
|
||||
return result
|
||||
}
|
||||
#endif
|
||||
|
||||
@inlinable
|
||||
func map<T>(_ keyPath: WritableKeyPath<Self, T>, _ transform: (T) throws -> T) rethrows -> Self {
|
||||
var result = self
|
||||
|
||||
Reference in new issue
Block a user