diff --git a/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClient+async.swift b/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClient+async.swift index 45f82f26..29f33c81 100644 --- a/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClient+async.swift +++ b/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClient+async.swift @@ -11,7 +11,12 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import Dispatch +import FoundationEssentials +#else import Foundation +#endif import NIOCore @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) diff --git a/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClientV5+async.swift b/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClientV5+async.swift index 059cc7c4..802d61d7 100644 --- a/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClientV5+async.swift +++ b/Sources/MQTTNIO/AsyncAwaitSupport/MQTTClientV5+async.swift @@ -11,7 +11,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif import NIOCore @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) diff --git a/Sources/MQTTNIO/MQTTConnection.swift b/Sources/MQTTNIO/MQTTConnection.swift index 6d301009..d1e87fa8 100644 --- a/Sources/MQTTNIO/MQTTConnection.swift +++ b/Sources/MQTTNIO/MQTTConnection.swift @@ -11,7 +11,11 @@ // //===----------------------------------------------------------------------===// +#if canImport(FoundationEssentials) +import FoundationEssentials +#else import Foundation +#endif #if canImport(Network) import Network #endif diff --git a/Sources/MQTTNIO/MQTTPacket.swift b/Sources/MQTTNIO/MQTTPacket.swift index d0666dc3..c10a8e96 100644 --- a/Sources/MQTTNIO/MQTTPacket.swift +++ b/Sources/MQTTNIO/MQTTPacket.swift @@ -623,7 +623,7 @@ struct MQTTAuthPacket: MQTTPacket { /// MQTT incoming packet parameters. struct MQTTIncomingPacket: MQTTPacket { - var description: String { "Incoming Packet 0x\(String(format: "%x", self.type.rawValue))" } + var description: String { "Incoming Packet 0x\(String(self.type.rawValue, radix: 16))" } /// Type of incoming MQTT packet. let type: MQTTPacketType