From 0ed753982d137a85452275f833222f7b9c360017 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 13 Nov 2023 13:28:42 +0200 Subject: [PATCH] Fix new swiftformat warnings: convert types used for hosting only static members into enums. --- ElementX/Sources/Other/Logging/MXLogger.swift | 2 +- ElementX/Sources/Screens/Authentication/UIConstants.swift | 2 +- IntegrationTests/Sources/Application.swift | 2 +- NSE/Sources/Other/DataProtectionManager.swift | 2 +- NSE/Sources/Other/NSELogger.swift | 2 +- UITests/Sources/Application.swift | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ElementX/Sources/Other/Logging/MXLogger.swift b/ElementX/Sources/Other/Logging/MXLogger.swift index eccbf53a1..a1906d952 100644 --- a/ElementX/Sources/Other/Logging/MXLogger.swift +++ b/ElementX/Sources/Other/Logging/MXLogger.swift @@ -21,7 +21,7 @@ import UIKit /// is called. The pool contains 3 files. /// /// `MXLogger` can track and log uncaught exceptions or crashes. -class MXLogger { +enum MXLogger { /// stderr so it can be restored. static var stderrSave: Int32 = 0 diff --git a/ElementX/Sources/Screens/Authentication/UIConstants.swift b/ElementX/Sources/Screens/Authentication/UIConstants.swift index 2f0d96993..5d36d2773 100644 --- a/ElementX/Sources/Screens/Authentication/UIConstants.swift +++ b/ElementX/Sources/Screens/Authentication/UIConstants.swift @@ -17,7 +17,7 @@ import SwiftUI /// Standard constants used across the app's UI. -struct UIConstants { +enum UIConstants { static let maxContentHeight: CGFloat = 750 /// The padding used between the top of the main content's icon and the navigation bar. diff --git a/IntegrationTests/Sources/Application.swift b/IntegrationTests/Sources/Application.swift index 5158815ee..e006bbc8e 100644 --- a/IntegrationTests/Sources/Application.swift +++ b/IntegrationTests/Sources/Application.swift @@ -16,7 +16,7 @@ import XCTest -struct Application { +enum Application { @discardableResult static func launch() -> XCUIApplication { let app = XCUIApplication() app.launch() diff --git a/NSE/Sources/Other/DataProtectionManager.swift b/NSE/Sources/Other/DataProtectionManager.swift index 6a519aa0a..059bbc402 100644 --- a/NSE/Sources/Other/DataProtectionManager.swift +++ b/NSE/Sources/Other/DataProtectionManager.swift @@ -16,7 +16,7 @@ import Foundation -final class DataProtectionManager { +enum DataProtectionManager { /// Detects after reboot, before unlocked state. Does this by trying to write a file to the filesystem (to the Caches directory) and read it back. /// - Parameter containerURL: Container url to write the file. /// - Returns: true if the state detected diff --git a/NSE/Sources/Other/NSELogger.swift b/NSE/Sources/Other/NSELogger.swift index 4abb97c73..38712d70b 100644 --- a/NSE/Sources/Other/NSELogger.swift +++ b/NSE/Sources/Other/NSELogger.swift @@ -17,7 +17,7 @@ import Foundation import MatrixRustSDK -class NSELogger { +enum NSELogger { private static var isConfigured = false /// Memory formatter, uses exact 2 fraction digits and no grouping diff --git a/UITests/Sources/Application.swift b/UITests/Sources/Application.swift index b598fe50c..9e1301317 100644 --- a/UITests/Sources/Application.swift +++ b/UITests/Sources/Application.swift @@ -17,7 +17,7 @@ import SnapshotTesting import XCTest -struct Application { +enum Application { static func launch(_ identifier: UITestsScreenIdentifier, disableTimelineAccessibility: Bool = true) -> XCUIApplication { let app = XCUIApplication()