diff --git a/Sources/Defaults/Defaults+AnySerializable.swift b/Sources/Defaults/Defaults+AnySerializable.swift index 88a15b1..6a1bdf1 100644 --- a/Sources/Defaults/Defaults+AnySerializable.swift +++ b/Sources/Defaults/Defaults+AnySerializable.swift @@ -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 } diff --git a/Sources/Defaults/Utilities.swift b/Sources/Defaults/Utilities.swift index 2a2356b..7921ea8 100644 --- a/Sources/Defaults/Utilities.swift +++ b/Sources/Defaults/Utilities.swift @@ -155,7 +155,7 @@ extension Sequence { Returns an array containing the non-nil elements. */ func compact() -> [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 } } } diff --git a/readme.md b/readme.md index 103ffe1..5e95e1f 100644 --- a/readme.md +++ b/readme.md @@ -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