Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Mar 1, 2022
1 parent cde447b commit 749c229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions Sources/LicensePlistCore/Entity/SwiftPackage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct SwiftPackageV2: Decodable {
let revision: String?
let version: String?
}

let identity: String
let location: String
let state: State
Expand All @@ -59,13 +59,11 @@ extension SwiftPackage {
return resolvedPackagesV1.object.pins.map {
SwiftPackage(package: $0.package, repositoryURL: $0.repositoryURL, revision: $0.state.revision, version: $0.state.version)
}
}
else if let resolvedPackagesV2 = try? JSONDecoder().decode(ResolvedPackagesV2.self, from: data) {
} else if let resolvedPackagesV2 = try? JSONDecoder().decode(ResolvedPackagesV2.self, from: data) {
return resolvedPackagesV2.pins.map {
SwiftPackage(package: $0.identity, repositoryURL: $0.location, revision: $0.state.revision, version: $0.state.version)
}
}
else {
} else {
return []
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/LicensePlistTests/Entity/SwiftPackageManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SwiftPackageManagerTests: XCTestCase {
XCTAssertEqual(package.state.branch, "master")
XCTAssertNil(package.state.version)
}

func testDecodingWithVersionV2() throws {
let jsonString = """
{
Expand All @@ -99,7 +99,7 @@ class SwiftPackageManagerTests: XCTestCase {
XCTAssertNil(package.state.branch)
XCTAssertEqual(package.state.version, "4.1.0")
}

func testDecodingWithBranchV2() throws {
let jsonString = """
{
Expand Down

0 comments on commit 749c229

Please sign in to comment.