Two infinite loop fixes (#359)

Both of these issues are fixes to `CustomStringConvertible` implementations that either directly or indirectly called themselves via `String(describing:)`.
This commit is contained in:
David Hunt 2021-01-19 15:13:48 +03:00 committed by GitHub
parent 9199a90551
commit ee4e8debc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ import CombineShim
public struct EnvironmentValues: CustomStringConvertible { public struct EnvironmentValues: CustomStringConvertible {
public var description: String { public var description: String {
String(describing: values) "EnvironmentValues: \(values.count)"
} }
private var values: [ObjectIdentifier: Any] = [:] private var values: [ObjectIdentifier: Any] = [:]

View File

@ -273,7 +273,7 @@ extension Color: CustomStringConvertible {
if let providerDescription = provider as? CustomStringConvertible { if let providerDescription = provider as? CustomStringConvertible {
return providerDescription.description return providerDescription.description
} else { } else {
return String(describing: self) return "Color: \(provider.self)"
} }
} }
} }