From 2dd9e72da6932e656ae89fe8f7749bd810ad36c5 Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Tue, 29 Jun 2021 12:49:39 -0500 Subject: [PATCH] Updated for Swift 5.4 --- Sources/BluetoothLinux/POSIXError.swift | 9 ++------- Sources/BluetoothLinux/Scan.swift | 2 -- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Sources/BluetoothLinux/POSIXError.swift b/Sources/BluetoothLinux/POSIXError.swift index 0e37ff9..31601c0 100755 --- a/Sources/BluetoothLinux/POSIXError.swift +++ b/Sources/BluetoothLinux/POSIXError.swift @@ -44,11 +44,13 @@ public extension POSIXError { } internal extension POSIXErrorCode { + var errorMessage: String { return String(cString: strerror(rawValue), encoding: .utf8)! } } +#if !swift(>=5.4) // MARK: - CustomStringConvertible // https://github.com/apple/swift/pull/24149 @@ -58,13 +60,6 @@ extension POSIXError: CustomStringConvertible { return _nsError.description } } - -#if os(macOS) -extension POSIXErrorCode: CustomStringConvertible { - public var description: String { - return rawValue.description - } -} #endif // MARK: - LocalizedError diff --git a/Sources/BluetoothLinux/Scan.swift b/Sources/BluetoothLinux/Scan.swift index 40bee33..528230e 100644 --- a/Sources/BluetoothLinux/Scan.swift +++ b/Sources/BluetoothLinux/Scan.swift @@ -80,8 +80,6 @@ public extension HostController { /// Otherwise, if flags is set to 0, then the results of previous inquiries may be returned, /// even if the devices aren't in range anymore. case flushCache = 0x0001 - - public static let allCases: Set = [.flushCache] } struct InquiryResult {