Minor tweaks
This commit is contained in:
parent
bab3087067
commit
d1e2109fc9
|
@ -59,43 +59,43 @@ extension Defaults.AnySerializable: Hashable {
|
|||
public func hash(into hasher: inout Hasher) {
|
||||
switch value {
|
||||
case let value as Data:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Date:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Bool:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as UInt8:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Int8:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as UInt16:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Int16:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as UInt32:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Int32:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as UInt64:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Int64:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as UInt:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Int:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Float:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as Double:
|
||||
return hasher.combine(value)
|
||||
case let value as CGFloat:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as CGFloat: // swiftlint:disable:this no_cgfloat
|
||||
hasher.combine(value)
|
||||
case let value as String:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as [AnyHashable: AnyHashable]:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
case let value as [AnyHashable]:
|
||||
return hasher.combine(value)
|
||||
hasher.combine(value)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ extension Sequence {
|
|||
Returns an array containing the non-nil elements.
|
||||
*/
|
||||
func compact<T>() -> [T] where Element == T? {
|
||||
// TODO: Make this `compactMap(\.self)` when https://bugs.swift.org/browse/SR-12897 is fixed.
|
||||
// TODO: Make this `compactMap(\.self)` when https://github.com/apple/swift/issues/55343 is fixed.
|
||||
compactMap { $0 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,8 @@ If a type conforms to both `NSSecureCoding` and `Codable`, then `Codable` will b
|
|||
|
||||
You declare the defaults keys upfront with type and default value.
|
||||
|
||||
**Do not use a dot in the key name, because of [this bug](https://github.com/sindresorhus/Defaults/issues/59).**
|
||||
|
||||
```swift
|
||||
import Cocoa
|
||||
import Defaults
|
||||
|
|
Loading…
Reference in New Issue