From eabe1333a7feb7da7a285cc4fcbc33d1bb6bbe4e Mon Sep 17 00:00:00 2001 From: Paul Toffoloni Date: Tue, 19 Nov 2024 10:04:52 +0100 Subject: [PATCH] Fix imports and rename some files --- ...Decoder.Decoder.swift => FormDataDecoder+Decoder.swift} | 0 ...ontainer.swift => FormDataDecoder+KeyedContainer.swift} | 0 ...er.swift => FormDataDecoder+SingleValueContainer.swift} | 6 +++++- ...tainer.swift => FormDataDecoder+UnkeyedContainer.swift} | 0 Sources/MultipartKit/MultipartSection.swift | 1 - Sources/MultipartKit/Utilities.swift | 6 +++++- Tests/MultipartKitTests/FormDataEncodingTests.swift | 7 ++++++- 7 files changed, 16 insertions(+), 4 deletions(-) rename Sources/MultipartKit/FormDataDecoder/{FormDataDecoder.Decoder.swift => FormDataDecoder+Decoder.swift} (100%) rename Sources/MultipartKit/FormDataDecoder/{FormDataDecoder.KeyedContainer.swift => FormDataDecoder+KeyedContainer.swift} (100%) rename Sources/MultipartKit/FormDataDecoder/{FormDataDecoder.SingleValueContainer.swift => FormDataDecoder+SingleValueContainer.swift} (95%) rename Sources/MultipartKit/FormDataDecoder/{FormDataDecoder.UnkeyedContainer.swift => FormDataDecoder+UnkeyedContainer.swift} (100%) diff --git a/Sources/MultipartKit/FormDataDecoder/FormDataDecoder.Decoder.swift b/Sources/MultipartKit/FormDataDecoder/FormDataDecoder+Decoder.swift similarity index 100% rename from Sources/MultipartKit/FormDataDecoder/FormDataDecoder.Decoder.swift rename to Sources/MultipartKit/FormDataDecoder/FormDataDecoder+Decoder.swift diff --git a/Sources/MultipartKit/FormDataDecoder/FormDataDecoder.KeyedContainer.swift b/Sources/MultipartKit/FormDataDecoder/FormDataDecoder+KeyedContainer.swift similarity index 100% rename from Sources/MultipartKit/FormDataDecoder/FormDataDecoder.KeyedContainer.swift rename to Sources/MultipartKit/FormDataDecoder/FormDataDecoder+KeyedContainer.swift diff --git a/Sources/MultipartKit/FormDataDecoder/FormDataDecoder.SingleValueContainer.swift b/Sources/MultipartKit/FormDataDecoder/FormDataDecoder+SingleValueContainer.swift similarity index 95% rename from Sources/MultipartKit/FormDataDecoder/FormDataDecoder.SingleValueContainer.swift rename to Sources/MultipartKit/FormDataDecoder/FormDataDecoder+SingleValueContainer.swift index 95570a9..2ba2311 100644 --- a/Sources/MultipartKit/FormDataDecoder/FormDataDecoder.SingleValueContainer.swift +++ b/Sources/MultipartKit/FormDataDecoder/FormDataDecoder+SingleValueContainer.swift @@ -1,4 +1,8 @@ -import Foundation +#if canImport(FoundationEssentials) + import FoundationEssentials +#else + import Foundation +#endif extension FormDataDecoder.Decoder: SingleValueDecodingContainer { func decodeNil() -> Bool { diff --git a/Sources/MultipartKit/FormDataDecoder/FormDataDecoder.UnkeyedContainer.swift b/Sources/MultipartKit/FormDataDecoder/FormDataDecoder+UnkeyedContainer.swift similarity index 100% rename from Sources/MultipartKit/FormDataDecoder/FormDataDecoder.UnkeyedContainer.swift rename to Sources/MultipartKit/FormDataDecoder/FormDataDecoder+UnkeyedContainer.swift diff --git a/Sources/MultipartKit/MultipartSection.swift b/Sources/MultipartKit/MultipartSection.swift index 6677c4b..3e2ad14 100644 --- a/Sources/MultipartKit/MultipartSection.swift +++ b/Sources/MultipartKit/MultipartSection.swift @@ -1,4 +1,3 @@ -import Foundation import HTTPTypes public enum MultipartSection: Equatable, Sendable { diff --git a/Sources/MultipartKit/Utilities.swift b/Sources/MultipartKit/Utilities.swift index ad0727c..5474236 100644 --- a/Sources/MultipartKit/Utilities.swift +++ b/Sources/MultipartKit/Utilities.swift @@ -1,4 +1,8 @@ -import Foundation +#if canImport(FoundationEssentials) + import FoundationEssentials +#else + import Foundation +#endif import HTTPTypes extension HTTPFields { diff --git a/Tests/MultipartKitTests/FormDataEncodingTests.swift b/Tests/MultipartKitTests/FormDataEncodingTests.swift index 6b47d34..9595b98 100644 --- a/Tests/MultipartKitTests/FormDataEncodingTests.swift +++ b/Tests/MultipartKitTests/FormDataEncodingTests.swift @@ -1,4 +1,9 @@ -import Foundation +#if canImport(FoundationEssentials) + import FoundationEssentials +#else + import Foundation +#endif + import MultipartKit import Testing