diff --git a/Sources/CustomDump/Conformances/Foundation.swift b/Sources/CustomDump/Conformances/Foundation.swift index d0a4b87..7b32936 100644 --- a/Sources/CustomDump/Conformances/Foundation.swift +++ b/Sources/CustomDump/Conformances/Foundation.swift @@ -1,3 +1,4 @@ +#if canImport(Foundation) import Foundation #if canImport(FoundationNetworking) @@ -321,3 +322,4 @@ extension UUID: CustomDumpStringConvertible { "UUID(\(self.uuidString))" } } +#endif diff --git a/Sources/CustomDump/Conformances/KeyPath.swift b/Sources/CustomDump/Conformances/KeyPath.swift index 3b5b557..cfbc636 100644 --- a/Sources/CustomDump/Conformances/KeyPath.swift +++ b/Sources/CustomDump/Conformances/KeyPath.swift @@ -1,5 +1,3 @@ -import Foundation - extension AnyKeyPath: CustomDumpStringConvertible { public var customDumpDescription: String { if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) { diff --git a/Sources/CustomDump/Conformances/Swift.swift b/Sources/CustomDump/Conformances/Swift.swift index 7e37f27..fb513e0 100644 --- a/Sources/CustomDump/Conformances/Swift.swift +++ b/Sources/CustomDump/Conformances/Swift.swift @@ -1,5 +1,3 @@ -import Foundation - extension Character: CustomDumpRepresentable { public var customDumpValue: Any { String(self) diff --git a/Sources/CustomDump/Internal/String.swift b/Sources/CustomDump/Internal/String.swift index e6434c1..e8ab293 100644 --- a/Sources/CustomDump/Internal/String.swift +++ b/Sources/CustomDump/Internal/String.swift @@ -1,5 +1,3 @@ -import Foundation - extension String { init?(stringProtocol value: Any) { guard let value = value as? any StringProtocol else { return nil } diff --git a/Sources/CustomDump/Internal/Unordered.swift b/Sources/CustomDump/Internal/Unordered.swift index f47cd61..b0a4212 100644 --- a/Sources/CustomDump/Internal/Unordered.swift +++ b/Sources/CustomDump/Internal/Unordered.swift @@ -1,7 +1,11 @@ +#if canImport(Foundation) import Foundation +#endif public protocol _UnorderedCollection {} +#if canImport(Foundation) extension Dictionary: _UnorderedCollection {} extension NSDictionary: _UnorderedCollection {} extension NSSet: _UnorderedCollection {} +#endif extension Set: _UnorderedCollection {} diff --git a/Tests/CustomDumpTests/Conformances/FoundationTests.swift b/Tests/CustomDumpTests/Conformances/FoundationTests.swift index 2d10ab6..fe0349d 100644 --- a/Tests/CustomDumpTests/Conformances/FoundationTests.swift +++ b/Tests/CustomDumpTests/Conformances/FoundationTests.swift @@ -1,5 +1,4 @@ import CustomDump -import Foundation import XCTest #if canImport(FoundationNetworking) diff --git a/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift b/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift index 8315fde..ab10abb 100644 --- a/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift +++ b/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift @@ -1,5 +1,4 @@ import CustomDump -import Foundation import XCTest #if canImport(Testing)