From 7fef81147f7e102f70035aed5754d20b797d424b Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Fri, 14 Jun 2024 14:10:59 -0700 Subject: [PATCH 1/6] Swift Language Support: Drop <5.9, Add 6.0 --- .github/workflows/ci.yml | 20 ++--------- Package.swift | 5 ++- ...swift-5.9.swift => Package@swift-6.0.swift | 5 +-- Sources/CustomDump/Conformances/KeyPath.swift | 9 ++--- Sources/CustomDump/Conformances/Swift.swift | 20 +++++------ .../Conformances/UserNotifications.swift | 31 +++++------------ Tests/CustomDumpTests/DumpTests.swift | 34 +++++++++---------- 7 files changed, 44 insertions(+), 80 deletions(-) rename Package@swift-5.9.swift => Package@swift-6.0.swift (85%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d93c580..7d6b91d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,27 +16,11 @@ concurrency: jobs: macos-14: name: macOS 14 (Xcode ${{ matrix.xcode }}) - runs-on: macOS-13 + runs-on: macOS-14 strategy: matrix: xcode: - - '15.2' - steps: - - uses: actions/checkout@v4 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app - - name: Print Swift version - run: swift --version - - name: Run tests (platforms) - run: make test-platforms - - macos-13: - name: macOS 13 (Xcode ${{ matrix.xcode }}) - runs-on: macOS-13 - strategy: - matrix: - xcode: - - '14.3.1' + - '15.4' steps: - uses: actions/checkout@v4 - name: Select Xcode ${{ matrix.xcode }} diff --git a/Package.swift b/Package.swift index e5c40e1..f41f022 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version: 5.9 import PackageDescription @@ -24,6 +24,9 @@ let package = Package( name: "CustomDump", dependencies: [ .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay") + ], + swiftSettings: [ + .enableExperimentalFeature("StrictConcurrency") ] ), .testTarget( diff --git a/Package@swift-5.9.swift b/Package@swift-6.0.swift similarity index 85% rename from Package@swift-5.9.swift rename to Package@swift-6.0.swift index 8866f19..018d21c 100644 --- a/Package@swift-5.9.swift +++ b/Package@swift-6.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.9 +// swift-tools-version: 6.0 import PackageDescription @@ -24,9 +24,6 @@ let package = Package( name: "CustomDump", dependencies: [ .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay") - ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") ] ), .testTarget( diff --git a/Sources/CustomDump/Conformances/KeyPath.swift b/Sources/CustomDump/Conformances/KeyPath.swift index 90a8f25..3b5b557 100644 --- a/Sources/CustomDump/Conformances/KeyPath.swift +++ b/Sources/CustomDump/Conformances/KeyPath.swift @@ -2,12 +2,9 @@ import Foundation extension AnyKeyPath: CustomDumpStringConvertible { public var customDumpDescription: String { - // NB: We gate this to 5.9+ due to this crasher: https://github.com/apple/swift/issues/64865 - #if swift(>=5.9) - if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) { - return self.debugDescription - } - #endif + if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) { + return self.debugDescription + } return """ \(typeName(Self.self))<\ \(typeName(Self.rootType, genericsAbbreviated: false)), \ diff --git a/Sources/CustomDump/Conformances/Swift.swift b/Sources/CustomDump/Conformances/Swift.swift index 1e51262..1313879 100644 --- a/Sources/CustomDump/Conformances/Swift.swift +++ b/Sources/CustomDump/Conformances/Swift.swift @@ -6,19 +6,17 @@ extension Character: CustomDumpRepresentable { } } -#if (swift(>=5.7) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))) || (swift(>=5.7.1) && os(macOS)) - @available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) - extension Duration: CustomDumpStringConvertible { - public var customDumpDescription: String { - self.formatted( - .units( - allowed: [.days, .hours, .minutes, .seconds, .milliseconds, .microseconds, .nanoseconds], - width: .wide - ) +@available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) +extension Duration: CustomDumpStringConvertible { + public var customDumpDescription: String { + self.formatted( + .units( + allowed: [.days, .hours, .minutes, .seconds, .milliseconds, .microseconds, .nanoseconds], + width: .wide ) - } + ) } -#endif +} extension ObjectIdentifier: CustomDumpStringConvertible { public var customDumpDescription: String { diff --git a/Sources/CustomDump/Conformances/UserNotifications.swift b/Sources/CustomDump/Conformances/UserNotifications.swift index a3bf94e..a984c6e 100644 --- a/Sources/CustomDump/Conformances/UserNotifications.swift +++ b/Sources/CustomDump/Conformances/UserNotifications.swift @@ -29,7 +29,7 @@ switch self.rawValue { case .alert: return "UNAuthorizationOptions.alert" - #if (os(iOS) || os(watchOS)) && (swift(<5.9) || !canImport(CompositorServices)) + #if os(iOS) || os(watchOS) case .announcement: return "UNAuthorizationOptions.announcement" #endif @@ -56,7 +56,7 @@ var allCases: [UNAuthorizationOptions] = [ .alert ] - #if (os(iOS) || os(watchOS)) && (swift(<5.9) || !canImport(CompositorServices)) + #if os(iOS) || os(watchOS) allCases.append(.announcement) #endif allCases.append(contentsOf: [ @@ -132,11 +132,9 @@ struct Option: CustomDumpStringConvertible { var rawValue: UNNotificationPresentationOptions var customDumpDescription: String { - #if swift(<5.9) || !canImport(CompositorServices) - if self.rawValue == .alert { - return "UNNotificationPresentationOptions.alert" - } - #endif + if self.rawValue == .alert { + return "UNNotificationPresentationOptions.alert" + } if self.rawValue == .badge { return "UNNotificationPresentationOptions.badge" } @@ -155,8 +153,10 @@ var options = self var children: [Option] = [] - var allCases: [UNNotificationPresentationOptions] = [] - appendBannerList(&allCases) + var allCases: [UNNotificationPresentationOptions] = [.alert, .badge] + if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) { + allCases.append(contentsOf: [.banner, .list]) + } allCases.append(.sound) for option in allCases { if options.contains(option) { @@ -174,19 +174,6 @@ displayStyle: .set ) } - - // NB: Workaround for Xcode 13.2's new, experimental build system. - // - // defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 - private func appendBannerList(_ allCases: inout [UNNotificationPresentationOptions]) { - #if swift(<5.9) || !canImport(CompositorServices) - allCases.append(.alert) - #endif - allCases.append(.badge) - if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) { - allCases.append(contentsOf: [.banner, .list]) - } - } } @available(iOS 10, macOS 10.14, tvOS 10, watchOS 3, *) diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 7f1762d..8ea4a43 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -708,7 +708,7 @@ final class DumpTests: XCTestCase { } func testKeyPath() { - // NB: While this should run on >=5.9, it currently crashes CI on Xcode 15.2 + // NB: While this should run on >=5.9, it currently crashes CI on Xcode 15 #if swift(>=5.10) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) var dump = "" if #available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) { @@ -1184,25 +1184,23 @@ final class DumpTests: XCTestCase { ) } - #if (swift(>=5.7) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))) || (swift(>=5.7.1) && os(macOS)) - func testDuration() { - guard #available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) else { return } + func testDuration() { + guard #available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) else { return } - XCTAssertNoDifference( - String(customDumping: Duration.seconds(5)), - """ - 5 seconds - """ - ) + XCTAssertNoDifference( + String(customDumping: Duration.seconds(5)), + """ + 5 seconds + """ + ) - XCTAssertNoDifference( - String(customDumping: Duration.seconds(5) + .milliseconds(123)), - """ - 5 seconds, 123 milliseconds - """ - ) - } - #endif + XCTAssertNoDifference( + String(customDumping: Duration.seconds(5) + .milliseconds(123)), + """ + 5 seconds, 123 milliseconds + """ + ) + } #if canImport(CoreGraphics) func testCoreGraphics() { From 090b191eea9cfc85daa759f238fc4d6e74a29531 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Fri, 14 Jun 2024 14:14:28 -0700 Subject: [PATCH 2/6] wip --- Sources/CustomDump/Conformances/Swift.swift | 20 +++++++------ Tests/CustomDumpTests/DumpTests.swift | 32 +++++++++++---------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Sources/CustomDump/Conformances/Swift.swift b/Sources/CustomDump/Conformances/Swift.swift index 1313879..d781063 100644 --- a/Sources/CustomDump/Conformances/Swift.swift +++ b/Sources/CustomDump/Conformances/Swift.swift @@ -6,17 +6,19 @@ extension Character: CustomDumpRepresentable { } } -@available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) -extension Duration: CustomDumpStringConvertible { - public var customDumpDescription: String { - self.formatted( - .units( - allowed: [.days, .hours, .minutes, .seconds, .milliseconds, .microseconds, .nanoseconds], - width: .wide +#if !os(WASI) + @available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) + extension Duration: CustomDumpStringConvertible { + public var customDumpDescription: String { + self.formatted( + .units( + allowed: [.days, .hours, .minutes, .seconds, .milliseconds, .microseconds, .nanoseconds], + width: .wide + ) ) - ) + } } -} +#endif extension ObjectIdentifier: CustomDumpStringConvertible { public var customDumpDescription: String { diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 8ea4a43..4282d35 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -1184,23 +1184,25 @@ final class DumpTests: XCTestCase { ) } - func testDuration() { - guard #available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) else { return } + #if !os(WASI) + func testDuration() { + guard #available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) else { return } - XCTAssertNoDifference( - String(customDumping: Duration.seconds(5)), - """ - 5 seconds - """ - ) + XCTAssertNoDifference( + String(customDumping: Duration.seconds(5)), + """ + 5 seconds + """ + ) - XCTAssertNoDifference( - String(customDumping: Duration.seconds(5) + .milliseconds(123)), - """ - 5 seconds, 123 milliseconds - """ - ) - } + XCTAssertNoDifference( + String(customDumping: Duration.seconds(5) + .milliseconds(123)), + """ + 5 seconds, 123 milliseconds + """ + ) + } + #endif #if canImport(CoreGraphics) func testCoreGraphics() { From 09c2a2d41e56aca1bf906517f8a9b89d9825644f Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Fri, 14 Jun 2024 14:15:06 -0700 Subject: [PATCH 3/6] wip --- Sources/CustomDump/Conformances/Swift.swift | 2 +- Tests/CustomDumpTests/DumpTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CustomDump/Conformances/Swift.swift b/Sources/CustomDump/Conformances/Swift.swift index d781063..7e37f27 100644 --- a/Sources/CustomDump/Conformances/Swift.swift +++ b/Sources/CustomDump/Conformances/Swift.swift @@ -6,7 +6,7 @@ extension Character: CustomDumpRepresentable { } } -#if !os(WASI) +#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) @available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) extension Duration: CustomDumpStringConvertible { public var customDumpDescription: String { diff --git a/Tests/CustomDumpTests/DumpTests.swift b/Tests/CustomDumpTests/DumpTests.swift index 4282d35..b42f0f4 100644 --- a/Tests/CustomDumpTests/DumpTests.swift +++ b/Tests/CustomDumpTests/DumpTests.swift @@ -1184,7 +1184,7 @@ final class DumpTests: XCTestCase { ) } - #if !os(WASI) + #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) func testDuration() { guard #available(macOS 13, iOS 16, watchOS 9, tvOS 16, *) else { return } From 3d70d59c0ee3751028da6b92ef2aa4f8c152d22a Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Sat, 15 Jun 2024 08:19:25 -0700 Subject: [PATCH 4/6] wip --- Sources/CustomDump/Internal/Box.swift | 93 ++++++++------------------- 1 file changed, 27 insertions(+), 66 deletions(-) diff --git a/Sources/CustomDump/Internal/Box.swift b/Sources/CustomDump/Internal/Box.swift index 9e2ab54..2aa74a8 100644 --- a/Sources/CustomDump/Internal/Box.swift +++ b/Sources/CustomDump/Internal/Box.swift @@ -1,79 +1,40 @@ -enum Box {} - -// MARK: - Equatable - -protocol AnyEquatable { - static func isEqual(_ lhs: Any, _ rhs: Any) -> Bool -} - -extension Box: AnyEquatable where T: Equatable { - static func isEqual(_ lhs: Any, _ rhs: Any) -> Bool { - lhs as? T == rhs as? T - } -} - func isMirrorEqual(_ lhs: Any, _ rhs: Any) -> Bool { - func open(_: LHS.Type) -> Bool? { - (Box.self as? AnyEquatable.Type)?.isEqual(lhs, rhs) - } - if let isEqual = _openExistential(type(of: lhs), do: open) { return isEqual } - let lhsMirror = Mirror(customDumpReflecting: lhs) - let rhsMirror = Mirror(customDumpReflecting: rhs) - guard - lhsMirror.subjectType == rhsMirror.subjectType, - lhsMirror.children.count == rhsMirror.children.count - else { return false } - guard !lhsMirror.children.isEmpty, !rhsMirror.children.isEmpty - else { - return String(describing: lhs) == String(describing: rhs) - } - for (lhsChild, rhsChild) in zip(lhsMirror.children, rhsMirror.children) { + guard let lhs = lhs as? any Equatable else { + let lhsMirror = Mirror(customDumpReflecting: lhs) + let rhsMirror = Mirror(customDumpReflecting: rhs) guard - lhsChild.label == rhsChild.label, - isMirrorEqual(lhsChild.value, rhsChild.value) + lhsMirror.subjectType == rhsMirror.subjectType, + lhsMirror.children.count == rhsMirror.children.count else { return false } + guard !lhsMirror.children.isEmpty, !rhsMirror.children.isEmpty + else { + return String(describing: lhs) == String(describing: rhs) + } + for (lhsChild, rhsChild) in zip(lhsMirror.children, rhsMirror.children) { + guard + lhsChild.label == rhsChild.label, + isMirrorEqual(lhsChild.value, rhsChild.value) + else { return false } + } + return true } - return true -} - -// MARK: - Identifiable - -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) -protocol AnyIdentifiable { - static func isIdentityEqual(_ lhs: Any, _ rhs: Any) -> Bool -} - -@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) -extension Box: AnyIdentifiable where T: Identifiable { - static func isIdentityEqual(_ lhs: Any, _ rhs: Any) -> Bool { - guard let lhs = lhs as? T, let rhs = rhs as? T else { return false } - return lhs.id == rhs.id + func open(_ lhs: T) -> Bool { + guard let rhs = rhs as? T else { return false } + return lhs == rhs } + return open(lhs) } func isIdentityEqual(_ lhs: Any, _ rhs: Any) -> Bool { - guard #available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *) else { return false } - func open(_: LHS.Type) -> Bool? { - (Box.self as? AnyIdentifiable.Type)?.isIdentityEqual(lhs, rhs) - } - return _openExistential(type(of: lhs), do: open) ?? false -} - -// MARK: - StringProtocol - -protocol AnyStringProtocol { - static func string(from value: Any) -> String? -} - -extension Box: AnyStringProtocol where T: StringProtocol { - static func string(from value: Any) -> String? { - (value as? T).map { String($0) } + guard let lhs = lhs as? any Identifiable else { return false } + func open(_ lhs: LHS) -> Bool { + guard let rhs = rhs as? LHS else { return false } + return lhs.id == rhs.id } + return open(lhs) } func stringFromStringProtocol(_ value: Any) -> String? { - func open(_: STR.Type) -> String? { - (Box.self as? AnyStringProtocol.Type)?.string(from: value) - } - return _openExistential(type(of: value), do: open) + guard let value = value as? any StringProtocol else { return nil } + return String(value) } From 36dad48d21f9dbd6e200007bb9826488b2c4e9d2 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Sat, 15 Jun 2024 08:23:11 -0700 Subject: [PATCH 5/6] wip --- Sources/CustomDump/Diff.swift | 4 +- Sources/CustomDump/Dump.swift | 2 +- Sources/CustomDump/Internal/Box.swift | 40 ------------------- .../CustomDump/Internal/Identifiable.swift | 8 ++++ Sources/CustomDump/Internal/Mirror.swift | 27 +++++++++++++ Sources/CustomDump/Internal/String.swift | 5 +++ 6 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 Sources/CustomDump/Internal/Box.swift create mode 100644 Sources/CustomDump/Internal/Identifiable.swift diff --git a/Sources/CustomDump/Diff.swift b/Sources/CustomDump/Diff.swift index f357b77..df5ab0f 100644 --- a/Sources/CustomDump/Diff.swift +++ b/Sources/CustomDump/Diff.swift @@ -692,8 +692,8 @@ public func diff(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String ) default: - if let lhs = stringFromStringProtocol(lhs), - let rhs = stringFromStringProtocol(rhs), + if let lhs = String(stringProtocol: lhs), + let rhs = String(stringProtocol: rhs), lhs.contains(where: \.isNewline) || rhs.contains(where: \.isNewline) { let lhsMirror = Mirror( diff --git a/Sources/CustomDump/Dump.swift b/Sources/CustomDump/Dump.swift index 510b394..e1e7d92 100644 --- a/Sources/CustomDump/Dump.swift +++ b/Sources/CustomDump/Dump.swift @@ -411,7 +411,7 @@ func _customDump( ) default: - if let value = stringFromStringProtocol(value) { + if let value = String(stringProtocol: value) { if value.contains(where: \.isNewline) { if maxDepth <= 0 { out.write("\"…\"") diff --git a/Sources/CustomDump/Internal/Box.swift b/Sources/CustomDump/Internal/Box.swift deleted file mode 100644 index 2aa74a8..0000000 --- a/Sources/CustomDump/Internal/Box.swift +++ /dev/null @@ -1,40 +0,0 @@ -func isMirrorEqual(_ lhs: Any, _ rhs: Any) -> Bool { - guard let lhs = lhs as? any Equatable else { - let lhsMirror = Mirror(customDumpReflecting: lhs) - let rhsMirror = Mirror(customDumpReflecting: rhs) - guard - lhsMirror.subjectType == rhsMirror.subjectType, - lhsMirror.children.count == rhsMirror.children.count - else { return false } - guard !lhsMirror.children.isEmpty, !rhsMirror.children.isEmpty - else { - return String(describing: lhs) == String(describing: rhs) - } - for (lhsChild, rhsChild) in zip(lhsMirror.children, rhsMirror.children) { - guard - lhsChild.label == rhsChild.label, - isMirrorEqual(lhsChild.value, rhsChild.value) - else { return false } - } - return true - } - func open(_ lhs: T) -> Bool { - guard let rhs = rhs as? T else { return false } - return lhs == rhs - } - return open(lhs) -} - -func isIdentityEqual(_ lhs: Any, _ rhs: Any) -> Bool { - guard let lhs = lhs as? any Identifiable else { return false } - func open(_ lhs: LHS) -> Bool { - guard let rhs = rhs as? LHS else { return false } - return lhs.id == rhs.id - } - return open(lhs) -} - -func stringFromStringProtocol(_ value: Any) -> String? { - guard let value = value as? any StringProtocol else { return nil } - return String(value) -} diff --git a/Sources/CustomDump/Internal/Identifiable.swift b/Sources/CustomDump/Internal/Identifiable.swift new file mode 100644 index 0000000..3abeb9a --- /dev/null +++ b/Sources/CustomDump/Internal/Identifiable.swift @@ -0,0 +1,8 @@ +func isIdentityEqual(_ lhs: Any, _ rhs: Any) -> Bool { + guard let lhs = lhs as? any Identifiable else { return false } + func open(_ lhs: LHS) -> Bool { + guard let rhs = rhs as? LHS else { return false } + return lhs.id == rhs.id + } + return open(lhs) +} diff --git a/Sources/CustomDump/Internal/Mirror.swift b/Sources/CustomDump/Internal/Mirror.swift index f9a592d..8929fe6 100644 --- a/Sources/CustomDump/Internal/Mirror.swift +++ b/Sources/CustomDump/Internal/Mirror.swift @@ -25,3 +25,30 @@ extension Mirror { } } } + +func isMirrorEqual(_ lhs: Any, _ rhs: Any) -> Bool { + guard let lhs = lhs as? any Equatable else { + let lhsMirror = Mirror(customDumpReflecting: lhs) + let rhsMirror = Mirror(customDumpReflecting: rhs) + guard + lhsMirror.subjectType == rhsMirror.subjectType, + lhsMirror.children.count == rhsMirror.children.count + else { return false } + guard !lhsMirror.children.isEmpty, !rhsMirror.children.isEmpty + else { + return String(describing: lhs) == String(describing: rhs) + } + for (lhsChild, rhsChild) in zip(lhsMirror.children, rhsMirror.children) { + guard + lhsChild.label == rhsChild.label, + isMirrorEqual(lhsChild.value, rhsChild.value) + else { return false } + } + return true + } + func open(_ lhs: T) -> Bool { + guard let rhs = rhs as? T else { return false } + return lhs == rhs + } + return open(lhs) +} diff --git a/Sources/CustomDump/Internal/String.swift b/Sources/CustomDump/Internal/String.swift index b655e9c..e6434c1 100644 --- a/Sources/CustomDump/Internal/String.swift +++ b/Sources/CustomDump/Internal/String.swift @@ -1,6 +1,11 @@ import Foundation extension String { + init?(stringProtocol value: Any) { + guard let value = value as? any StringProtocol else { return nil } + self.init(value) + } + func indenting(by count: Int) -> String { self.indenting(with: String(repeating: " ", count: count)) } From 861248cbf8042a8e9d14dd693b6107a65a7b2e0e Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Sat, 15 Jun 2024 08:24:35 -0700 Subject: [PATCH 6/6] wip --- Sources/CustomDump/Diff.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CustomDump/Diff.swift b/Sources/CustomDump/Diff.swift index df5ab0f..ab37502 100644 --- a/Sources/CustomDump/Diff.swift +++ b/Sources/CustomDump/Diff.swift @@ -207,7 +207,7 @@ public func diff(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String to: &out ) - if let areInIncreasingOrder = areInIncreasingOrder { + if let areInIncreasingOrder { lhsChildren.sort(by: areInIncreasingOrder) rhsChildren.sort(by: areInIncreasingOrder) }