From 3cadfd25a010e64caec511db8d636008a3072670 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Mon, 26 Aug 2024 16:11:50 -0400 Subject: [PATCH] remove some foundations --- Sources/CustomDump/Conformances/Foundation.swift | 2 ++ Sources/CustomDump/Conformances/KeyPath.swift | 2 -- Sources/CustomDump/Conformances/Swift.swift | 2 -- Sources/CustomDump/Internal/String.swift | 2 -- Sources/CustomDump/Internal/Unordered.swift | 4 ++++ Tests/CustomDumpTests/Conformances/FoundationTests.swift | 1 - Tests/CustomDumpTests/ExpectNoDifferenceTests.swift | 1 - 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Sources/CustomDump/Conformances/Foundation.swift b/Sources/CustomDump/Conformances/Foundation.swift index d0a4b879..7b329360 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 3b5b5578..cfbc6365 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 7e37f27b..fb513e0d 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 e6434c1b..e8ab2932 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 f47cd61e..b0a42121 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 2d10ab64..fe0349d6 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 8315fdee..ab10abb6 100644 --- a/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift +++ b/Tests/CustomDumpTests/ExpectNoDifferenceTests.swift @@ -1,5 +1,4 @@ import CustomDump -import Foundation import XCTest #if canImport(Testing)