Skip to content

Commit cff9e0d

Browse files
authored
Merge pull request #1284 from rgoldberg/1283-dependencies-and-cleanup
Update dependencies & code cleanup
2 parents 51cf594 + 28120a4 commit cff9e0d

11 files changed

Lines changed: 22 additions & 23 deletions

File tree

Package.resolved

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ _ = Package(
2525
.package(url: "https://github.com/apple/swift-collections", from: "1.6.0"),
2626
.package(url: "https://github.com/attaswift/BigInt", from: "6.0.0"),
2727
.package(url: "https://github.com/rarestype/swift-json", from: "3.5.0"),
28-
.package(url: "https://github.com/scinfu/SwiftSoup", from: "2.13.6"),
28+
.package(url: "https://github.com/scinfu/SwiftSoup", from: "2.13.7"),
2929
.package(url: "https://github.com/swiftlang/swift-subprocess", from: "0.5.0"),
3030
],
3131
targets: [

Sources/mas/Commands/MAS.List.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension MAS {
4848
return
4949
}
5050

51-
outputFormatOptionGroup.info(installedApps.map(String.init(describing:)).joined(separator: "\n"))
51+
outputFormatOptionGroup.info(installedApps.map(String.init).joined(separator: "\n"))
5252
}
5353
}
5454
}

Sources/mas/Commands/MAS.Lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extension MAS {
2929
}
3030

3131
func run(catalogApps: [CatalogApp]) {
32-
outputFormatOptionGroup.info(catalogApps.map(String.init(describing:)).joined(separator: "\n"))
32+
outputFormatOptionGroup.info(catalogApps.map(String.init).joined(separator: "\n"))
3333
}
3434
}
3535
}

Sources/mas/Commands/MAS.Search.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extension MAS {
3636
throw MASError.noCatalogAppsFound(for: searchTermOptionGroup.searchTerm)
3737
}
3838

39-
outputFormatOptionGroup.info(catalogApps.map(String.init(describing:)).joined(separator: "\n"))
39+
outputFormatOptionGroup.info(catalogApps.map(String.init).joined(separator: "\n"))
4040
}
4141
}
4242
}

Sources/mas/Models/AppStoreAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ enum AppStoreAction: String {
4747
}
4848

4949
func apps(withADAMIDs adamIDs: [ADAMID], force: Bool) async {
50-
let installedApps = await installedApps(withAppIDs: adamIDs.map(AppID.adamID(_:)), withFullJSON: false) { _ in }
50+
let installedApps = await installedApps(withAppIDs: adamIDs.map(AppID.adamID), withFullJSON: false) { _ in }
5151
await apps(
5252
withADAMIDs: force
5353
? adamIDs

Sources/mas/Models/CatalogApp.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private func lookup(appID: AppID, in region: Region) async throws -> CatalogApp
309309
{
310310
try .init(object: catalogAppJSONObject)
311311
} else {
312-
try await catalogAppJSONObjects(from: lookupURL, in: region).first.flatMap(CatalogApp.init(macDesktopAppObject:))
312+
try await catalogAppJSONObjects(from: lookupURL, in: region).first.flatMap(CatalogApp.init)
313313
?? { throw MASError.unknownAppID(appID) }()
314314
}
315315
}
@@ -321,8 +321,7 @@ func search(for term: String) async throws -> [CatalogApp] {
321321
private func search(for term: String, in region: Region) async throws -> [CatalogApp] {
322322
let searchURL = Environment.current.searchURL.appending(queryItems: [.init(name: "term", value: term)])
323323
async let macCatalogAppsTask =
324-
catalogAppJSONObjects(from: searchURL.appending(queryItems: macAppsURLQueryItem), in: region)
325-
.map(CatalogApp.init(object:))
324+
catalogAppJSONObjects(from: searchURL.appending(queryItems: macAppsURLQueryItem), in: region).map(CatalogApp.init)
326325
async let anyCatalogAppsTask = catalogAppJSONObjects(from: searchURL, in: region)
327326
let macCatalogApps = try await macCatalogAppsTask
328327
let adamIDSet = Set(macCatalogApps.map(\.adamID))

Sources/mas/Models/InstalledApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private func unsortedInstalledApps(matching appIDs: [AppID], withFullJSON: Bool)
349349
],
350350
)
351351
}
352-
.map(InstalledApp.init(for:))
352+
.map(InstalledApp.init)
353353
}
354354
}
355355

Sources/mas/Utilities/Output/Printer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct Printer {
119119
try? unsafe items.joined(separator: separator)
120120
.appending(terminator)
121121
.utf8
122-
.withContiguousStorageIfAvailable(fileHandle.write(contentsOf:))
122+
.withContiguousStorageIfAvailable(fileHandle.write)
123123
}
124124

125125
private func print(

Sources/mas/Utilities/Resources/Environment.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ struct Environment {
2121

2222
init(
2323
dataFrom: @escaping @Sendable (URL) async throws -> (Data, URLResponse)
24-
= URLSession(configuration: .ephemeral).data(from:),
25-
lookupAppFromAppID: @escaping @Sendable (AppID) async throws -> CatalogApp = lookup(appID:),
26-
searchForAppsMatchingSearchTerm: @escaping @Sendable (String) async throws -> [CatalogApp] = search(for:),
24+
= URLSession(configuration: .ephemeral).data,
25+
lookupAppFromAppID: @escaping @Sendable (AppID) async throws -> CatalogApp = lookup,
26+
searchForAppsMatchingSearchTerm: @escaping @Sendable (String) async throws -> [CatalogApp] = search,
2727
) {
2828
self.dataFrom = dataFrom
2929
self.lookupAppFromAppID = lookupAppFromAppID

0 commit comments

Comments
 (0)