Skip to content

Commit aaa419d

Browse files
committed
rename functions as swifty
1 parent d5f59b5 commit aaa419d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Sources/DangerDependenciesResolver/Package.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extension Package.Pinned {
3939
}
4040
}
4141

42-
// MARK: swift-tools-version >= 5.6
42+
// MARK: - swift-tools-version >= 5.6
4343
extension Package {
4444
struct PinnedV2: Decodable, Equatable {
4545
let name: String
@@ -63,7 +63,7 @@ extension Package.PinnedV2 {
6363
}
6464

6565
extension Package.PinnedV2 {
66-
func convertToV1() -> Package.Pinned {
66+
var v1: Package.Pinned {
6767
.init(
6868
name: name,
6969
url: url,
@@ -72,8 +72,9 @@ extension Package.PinnedV2 {
7272
}
7373
}
7474

75+
// MARK: -
7576
extension Sequence where Element == Package.PinnedV2 {
76-
func convertToV1() -> [Package.Pinned] {
77-
map { $0.convertToV1() }
77+
func v1Converted() -> [Package.Pinned] {
78+
map(\.v1)
7879
}
7980
}

Sources/DangerDependenciesResolver/PackageDataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct PackageDataProvider: PackageDataProviding {
9696
case let .v1(object):
9797
return object.pins
9898
case let .v2(pins):
99-
return pins.convertToV1()
99+
return pins.v1Converted()
100100
}
101101
}
102102

0 commit comments

Comments
 (0)