Skip to content

Commit

Permalink
Make Optional/Result more consistent with macro-generated code (#166
Browse files Browse the repository at this point in the history
)
  • Loading branch information
stephencelis authored Jun 13, 2024
1 parent b871e5e commit 65a41f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions Sources/CasePaths/Optional+CasePathable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ extension Optional: CasePathable {
}
)
}

private let _allCasePaths: [PartialCaseKeyPath<Optional>] = [
\.none,
\.some,
]
}

public static var allCasePaths: AllCasePaths {
Expand All @@ -75,6 +70,6 @@ extension Case {

extension Optional.AllCasePaths: Sequence {
public func makeIterator() -> some IteratorProtocol<PartialCaseKeyPath<Optional>> {
_allCasePaths.makeIterator()
[\.none, \.some].makeIterator()
}
}
7 changes: 1 addition & 6 deletions Sources/CasePaths/Result+CasePathable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ extension Result: CasePathable {
}
)
}

private let _allCasePaths: [PartialCaseKeyPath<Result>] = [
\.success,
\.failure,
]
}

public static var allCasePaths: AllCasePaths {
Expand All @@ -43,6 +38,6 @@ extension Result: CasePathable {

extension Result.AllCasePaths: Sequence {
public func makeIterator() -> some IteratorProtocol<PartialCaseKeyPath<Result>> {
_allCasePaths.makeIterator()
[\.success, \.failure].makeIterator()
}
}

0 comments on commit 65a41f6

Please sign in to comment.