From e927466dceb9801176e8d7b6f3463f7644b0ca2c Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:38:04 -0400 Subject: [PATCH] Use `Self`. Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Sources/mas/Controllers/MasStoreSearch.swift | 2 +- Sources/mas/ExternalCommands/SysCtlSystemCommand.swift | 2 +- Sources/mas/Mas.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/mas/Controllers/MasStoreSearch.swift b/Sources/mas/Controllers/MasStoreSearch.swift index 9680070..a2cf5b2 100644 --- a/Sources/mas/Controllers/MasStoreSearch.swift +++ b/Sources/mas/Controllers/MasStoreSearch.swift @@ -126,7 +126,7 @@ class MasStoreSearch: StoreSearch { } .map { data in guard let html = String(data: data, encoding: .utf8), - let capture = MasStoreSearch.appVersionExpression.firstMatch(in: html)?.captures[0], + let capture = Self.appVersionExpression.firstMatch(in: html)?.captures[0], let version = Version(tolerant: capture) else { return nil diff --git a/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift b/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift index cbb24d9..abd5fb8 100644 --- a/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift +++ b/Sources/mas/ExternalCommands/SysCtlSystemCommand.swift @@ -24,7 +24,7 @@ struct SysCtlSystemCommand: ExternalCommand { } static var isAppleSilicon: Bool = { - let sysctl = SysCtlSystemCommand() + let sysctl = Self() do { // Returns 1 on Apple Silicon even when run in an Intel context in Rosetta. try sysctl.run(arguments: "-in", "hw.optional.arm64") diff --git a/Sources/mas/Mas.swift b/Sources/mas/Mas.swift index 1d273fa..5fb8dda 100644 --- a/Sources/mas/Mas.swift +++ b/Sources/mas/Mas.swift @@ -36,7 +36,7 @@ struct Mas: ParsableCommand { ) func validate() throws { - Mas.initialize() + Self.initialize() } static func initialize() {