From bdd3bf565e84eab0fd612d07749e5b360d5e7d15 Mon Sep 17 00:00:00 2001 From: stephencelis Date: Tue, 16 Jul 2024 23:02:25 +0000 Subject: [PATCH] Run swift-format --- Sources/CasePaths/CasePathable.swift | 70 +++++++++---------- Sources/CasePaths/Optional+CasePathable.swift | 22 +++--- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Sources/CasePaths/CasePathable.swift b/Sources/CasePaths/CasePathable.swift index 97f2955..775308d 100644 --- a/Sources/CasePaths/CasePathable.swift +++ b/Sources/CasePaths/CasePathable.swift @@ -81,20 +81,20 @@ extension Case { // ) // } // #else - public subscript( - dynamicMember keyPath: KeyPath> - ) -> Case - where Value: CasePathable { - @UncheckedSendable var keyPath = keyPath - return Case( - embed: { [$keyPath] in - embed(Value.allCasePaths[keyPath: $keyPath.wrappedValue].embed($0)) - }, - extract: { [$keyPath] in - extract(from: $0).flatMap(Value.allCasePaths[keyPath: $keyPath.wrappedValue].extract) - } - ) - } + public subscript( + dynamicMember keyPath: KeyPath> + ) -> Case + where Value: CasePathable { + @UncheckedSendable var keyPath = keyPath + return Case( + embed: { [$keyPath] in + embed(Value.allCasePaths[keyPath: $keyPath.wrappedValue].embed($0)) + }, + extract: { [$keyPath] in + extract(from: $0).flatMap(Value.allCasePaths[keyPath: $keyPath.wrappedValue].extract) + } + ) + } // #endif public func embed(_ value: Value) -> Any { @@ -532,26 +532,26 @@ extension AnyCasePath where Value: CasePathable { // ) // } // #else - /// Returns a new case path created by appending the case path at the given key path to this one. - /// - /// This subscript is automatically invoked by case key path expressions via dynamic member - /// lookup, and should not be invoked directly. - /// - /// - Parameter keyPath: A key path to a case-pathable case path. - public subscript( - dynamicMember keyPath: KeyPath> - ) -> AnyCasePath { - @UncheckedSendable var keyPath = keyPath - return AnyCasePath( - embed: { [$keyPath] in - embed(Value.allCasePaths[keyPath: $keyPath.wrappedValue].embed($0)) - }, - extract: { [$keyPath] in - extract(from: $0).flatMap( - Value.allCasePaths[keyPath: $keyPath.wrappedValue].extract(from:) - ) - } - ) - } + /// Returns a new case path created by appending the case path at the given key path to this one. + /// + /// This subscript is automatically invoked by case key path expressions via dynamic member + /// lookup, and should not be invoked directly. + /// + /// - Parameter keyPath: A key path to a case-pathable case path. + public subscript( + dynamicMember keyPath: KeyPath> + ) -> AnyCasePath { + @UncheckedSendable var keyPath = keyPath + return AnyCasePath( + embed: { [$keyPath] in + embed(Value.allCasePaths[keyPath: $keyPath.wrappedValue].embed($0)) + }, + extract: { [$keyPath] in + extract(from: $0).flatMap( + Value.allCasePaths[keyPath: $keyPath.wrappedValue].extract(from:) + ) + } + ) + } // #endif } diff --git a/Sources/CasePaths/Optional+CasePathable.swift b/Sources/CasePaths/Optional+CasePathable.swift index 75d9220..bc7deaa 100644 --- a/Sources/CasePaths/Optional+CasePathable.swift +++ b/Sources/CasePaths/Optional+CasePathable.swift @@ -67,17 +67,17 @@ extension Case { // self[dynamicMember: keyPath].some // } // #else - /// A case path to the presence of a nested value. - /// - /// This subscript can chain into an optional's wrapped value without explicitly specifying each - /// `some` component. - @_disfavoredOverload - public subscript( - dynamicMember keyPath: KeyPath> - ) -> Case - where Value: CasePathable { - self[dynamicMember: keyPath].some - } + /// A case path to the presence of a nested value. + /// + /// This subscript can chain into an optional's wrapped value without explicitly specifying each + /// `some` component. + @_disfavoredOverload + public subscript( + dynamicMember keyPath: KeyPath> + ) -> Case + where Value: CasePathable { + self[dynamicMember: keyPath].some + } // #endif }