Skip to content

Commit f5cfc2c

Browse files
committed
All cases
1 parent 2b729a7 commit f5cfc2c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Sources/ProjectSpec/SwiftPackage.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ extension SwiftPackage.VersionRequirement: JSONUtilities.JSONObjectConvertible {
130130
self = .revision(revision)
131131
} else if let branch = json(atKeyPath: "branch") {
132132
self = .branch(branch)
133-
} else if jsonDictionary["minVersion"] != nil && jsonDictionary["maxVersion"] != nil {
134-
let minimum: String = try jsonDictionary.json(atKeyPath: "minVersion")
135-
let maximum: String = try jsonDictionary.json(atKeyPath: "maxVersion")
136-
self = .range(from: minimum, to: maximum)
133+
} else if let minVersion = json(atKeyPath: "minVersion"), let maxVersion = json(atKeyPath: "maxVersion") {
134+
self = .range(from: minVersion, to: maxVersion)
137135
} else if let minorVersion = json(atKeyPath: "minorVersion") {
138136
self = .upToNextMinorVersion(minorVersion)
139137
} else if let majorVersion = json(atKeyPath: "majorVersion") {

0 commit comments

Comments
 (0)