diff options
32 files changed, 55 insertions, 55 deletions
diff --git a/ios/MullvadLogging/CustomFormatLogHandler.swift b/ios/MullvadLogging/CustomFormatLogHandler.swift index 3ed4fe24cb..fefb8260ce 100644 --- a/ios/MullvadLogging/CustomFormatLogHandler.swift +++ b/ios/MullvadLogging/CustomFormatLogHandler.swift @@ -48,7 +48,7 @@ public struct CustomFormatLogHandler: LogHandler { line: UInt ) { let mergedMetadata = self.metadata - .merging(metadata ?? [:]) { lhs, rhs -> Logger.MetadataValue in + .merging(metadata ?? [:]) { _, rhs -> Logger.MetadataValue in rhs } let prettyMetadata = Self.formatMetadata(mergedMetadata) diff --git a/ios/MullvadLogging/OSLogHandler.swift b/ios/MullvadLogging/OSLogHandler.swift index 25501108ee..82791519d2 100644 --- a/ios/MullvadLogging/OSLogHandler.swift +++ b/ios/MullvadLogging/OSLogHandler.swift @@ -63,7 +63,7 @@ public struct OSLogHandler: LogHandler { line: UInt ) { let mergedMetadata = self.metadata - .merging(metadata ?? [:]) { lhs, rhs -> Logging.Logger.MetadataValue in + .merging(metadata ?? [:]) { _, rhs -> Logging.Logger.MetadataValue in rhs } let prettyMetadata = Self.formatMetadata(mergedMetadata) diff --git a/ios/MullvadREST/RESTRequestHandler.swift b/ios/MullvadREST/RESTRequestHandler.swift index 675553b852..a40212dcf5 100644 --- a/ios/MullvadREST/RESTRequestHandler.swift +++ b/ios/MullvadREST/RESTRequestHandler.swift @@ -30,7 +30,7 @@ extension REST { let authorizationProvider: RESTAuthorizationProvider? init(createURLRequest: @escaping (AnyIPEndpoint) throws -> REST.Request) { - _createURLRequest = { endpoint, authorization in + _createURLRequest = { endpoint, _ in try createURLRequest(endpoint) } authorizationProvider = nil diff --git a/ios/MullvadVPN/Classes/AutomaticKeyboardResponder.swift b/ios/MullvadVPN/Classes/AutomaticKeyboardResponder.swift index 8447bc1c65..99db0e966e 100644 --- a/ios/MullvadVPN/Classes/AutomaticKeyboardResponder.swift +++ b/ios/MullvadVPN/Classes/AutomaticKeyboardResponder.swift @@ -111,7 +111,7 @@ class AutomaticKeyboardResponder { presentationFrameObserver = containerView.observe( \.frame, options: [.new], - changeHandler: { [weak self] containingView, change in + changeHandler: { [weak self] _, _ in guard let self, let keyboardFrameValue = lastKeyboardRect else { return } diff --git a/ios/MullvadVPN/Coordinators/TunnelCoordinator.swift b/ios/MullvadVPN/Coordinators/TunnelCoordinator.swift index 6acb0405c3..da686aadca 100644 --- a/ios/MullvadVPN/Coordinators/TunnelCoordinator.swift +++ b/ios/MullvadVPN/Coordinators/TunnelCoordinator.swift @@ -41,7 +41,7 @@ class TunnelCoordinator: Coordinator { func start() { let tunnelObserver = - TunnelBlockObserver(didUpdateDeviceState: { [weak self] _, deviceState, previousDeviceState in + TunnelBlockObserver(didUpdateDeviceState: { [weak self] _, _, _ in self?.updateVisibility(animated: true) }) diff --git a/ios/MullvadVPN/Notifications/Notification Providers/RegisteredDeviceInAppNotificationProvider.swift b/ios/MullvadVPN/Notifications/Notification Providers/RegisteredDeviceInAppNotificationProvider.swift index bd16fc41d0..b9f2bb6307 100644 --- a/ios/MullvadVPN/Notifications/Notification Providers/RegisteredDeviceInAppNotificationProvider.swift +++ b/ios/MullvadVPN/Notifications/Notification Providers/RegisteredDeviceInAppNotificationProvider.swift @@ -34,7 +34,7 @@ final class RegisteredDeviceInAppNotificationProvider: NotificationProvider, let stylingOptions = MarkdownStylingOptions(font: .systemFont(ofSize: 14.0)) - return NSAttributedString(markdownString: string, options: stylingOptions) { markdownType, string in + return NSAttributedString(markdownString: string, options: stylingOptions) { markdownType, _ in switch markdownType { case .bold: return [.foregroundColor: UIColor.InAppNotificationBanner.titleColor] @@ -81,7 +81,7 @@ final class RegisteredDeviceInAppNotificationProvider: NotificationProvider, private func addObservers() { tunnelObserver = - TunnelBlockObserver(didUpdateDeviceState: { [weak self] tunnelManager, deviceState, previousDeviceState in + TunnelBlockObserver(didUpdateDeviceState: { [weak self] _, deviceState, previousDeviceState in if previousDeviceState == .loggedOut, case .loggedIn = deviceState { self?.isNewDeviceRegistered = true diff --git a/ios/MullvadVPN/Notifications/Notification Providers/TunnelStatusNotificationProvider.swift b/ios/MullvadVPN/Notifications/Notification Providers/TunnelStatusNotificationProvider.swift index 3cd792a150..021afc95ce 100644 --- a/ios/MullvadVPN/Notifications/Notification Providers/TunnelStatusNotificationProvider.swift +++ b/ios/MullvadVPN/Notifications/Notification Providers/TunnelStatusNotificationProvider.swift @@ -40,10 +40,10 @@ final class TunnelStatusNotificationProvider: NotificationProvider, InAppNotific didLoadConfiguration: { [weak self] tunnelManager in self?.handleTunnelStatus(tunnelManager.tunnelStatus) }, - didUpdateTunnelStatus: { [weak self] tunnelManager, tunnelStatus in + didUpdateTunnelStatus: { [weak self] _, tunnelStatus in self?.handleTunnelStatus(tunnelStatus) }, - didFailWithError: { [weak self] tunnelManager, error in + didFailWithError: { [weak self] _, error in self?.tunnelManagerError = error } ) diff --git a/ios/MullvadVPN/SceneDelegate.swift b/ios/MullvadVPN/SceneDelegate.swift index a80dd85953..4720556fe4 100644 --- a/ios/MullvadVPN/SceneDelegate.swift +++ b/ios/MullvadVPN/SceneDelegate.swift @@ -41,7 +41,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, SettingsMigrationUIHand didLoadConfiguration: { [weak self] _ in self?.configureScene() }, - didUpdateDeviceState: { [weak self] _, deviceState, previousDeviceState in + didUpdateDeviceState: { [weak self] _, deviceState, _ in self?.deviceStateDidChange(deviceState) } ) diff --git a/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift b/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift index ae9425cbac..108b6be81b 100644 --- a/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift +++ b/ios/MullvadVPN/TunnelManager/SetAccountOperation.swift @@ -101,7 +101,7 @@ class SetAccountOperation: ResultOperation<StoredAccountData?> { private func startLogoutFlow(completion: @escaping () -> Void) { switch interactor.deviceState { case let .loggedIn(accountData, deviceData): - deleteDevice(accountNumber: accountData.number, deviceIdentifier: deviceData.identifier) { [self] error in + deleteDevice(accountNumber: accountData.number, deviceIdentifier: deviceData.identifier) { [self] _ in unsetDeviceState(completion: completion) } diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift index d2c83f3bf5..aec42d87fd 100644 --- a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift +++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementContentView.swift @@ -253,7 +253,7 @@ class DeviceManagementContentView: UIView { showHideViews() self?.deviceStackView.layoutIfNeeded() }, - completion: { isComplete in + completion: { _ in removeViews() } ) diff --git a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift index 9da121b959..d730bdb0c9 100644 --- a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift +++ b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift @@ -107,7 +107,7 @@ class LoginContentView: UIView { keyboardResponder = AutomaticKeyboardResponder( targetView: self, - handler: { [weak self] view, adjustment in + handler: { [weak self] _, adjustment in self?.contentContainerBottomConstraint?.constant = adjustment self?.layoutIfNeeded() diff --git a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeInteractor.swift b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeInteractor.swift index a6676009ff..79f20ed675 100644 --- a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeInteractor.swift +++ b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeInteractor.swift @@ -34,10 +34,10 @@ final class OutOfTimeInteractor { self.tunnelManager = tunnelManager let tunnelObserver = TunnelBlockObserver( - didUpdateTunnelStatus: { [weak self] manager, tunnelStatus in + didUpdateTunnelStatus: { [weak self] _, tunnelStatus in self?.didReceiveTunnelStatus?(tunnelStatus) }, - didUpdateDeviceState: { [weak self] tunnelManager, deviceState, previousDeviceState in + didUpdateDeviceState: { [weak self] _, deviceState, previousDeviceState in let isInactive = previousDeviceState.accountData?.isExpired == true let isActive = deviceState.accountData?.isExpired == false if isInactive && isActive { @@ -46,7 +46,7 @@ final class OutOfTimeInteractor { } ) - let paymentObserver = StorePaymentBlockObserver { [weak self] manager, event in + let paymentObserver = StorePaymentBlockObserver { [weak self] _, event in self?.didReceivePaymentEvent?(event) } diff --git a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift index 9b37d77138..651886277f 100644 --- a/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift +++ b/ios/MullvadVPN/View controllers/OutOfTime/OutOfTimeViewController.swift @@ -98,7 +98,7 @@ class OutOfTimeViewController: UIViewController, RootContainment { self?.didReceivePaymentEvent(event) } - interactor.didReceiveTunnelStatus = { [weak self] tunnelStatus in + interactor.didReceiveTunnelStatus = { [weak self] _ in self?.setNeedsHeaderBarStyleAppearanceUpdate() self?.applyViewState() } diff --git a/ios/MullvadVPN/View controllers/Preferences/PreferencesDataSource.swift b/ios/MullvadVPN/View controllers/Preferences/PreferencesDataSource.swift index 6e1a131d5f..4a4c085294 100644 --- a/ios/MullvadVPN/View controllers/Preferences/PreferencesDataSource.swift +++ b/ios/MullvadVPN/View controllers/Preferences/PreferencesDataSource.swift @@ -216,7 +216,7 @@ final class PreferencesDataSource: UITableViewDiffableDataSource< ) self.preferencesCellFactory = preferencesCellFactory - super.init(tableView: tableView) { tableView, indexPath, itemIdentifier in + super.init(tableView: tableView) { _, indexPath, itemIdentifier in preferencesCellFactory.makeCell(for: itemIdentifier, indexPath: indexPath) } diff --git a/ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift b/ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift index 7bd7a80051..66df78917a 100644 --- a/ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift +++ b/ios/MullvadVPN/View controllers/Preferences/PreferencesInteractor.swift @@ -30,7 +30,7 @@ final class PreferencesInteractor { self.relayCacheTracker = relayCacheTracker tunnelObserver = - TunnelBlockObserver(didUpdateTunnelSettings: { [weak self] manager, newSettings in + TunnelBlockObserver(didUpdateTunnelSettings: { [weak self] _, newSettings in self?.tunnelSettingsDidChange?(newSettings) }) } diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift index 80de1e1ddb..93cfbde3eb 100644 --- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift +++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportViewController.swift @@ -453,7 +453,7 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { self.messageTextView.roundCorners = false self.view.layoutIfNeeded() - }) { completed in + }) { _ in self.isMessageTextViewExpanded = true self.textViewKeyboardResponder?.updateContentInsets() @@ -476,7 +476,7 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { self.messageTextView.roundCorners = true self.view.layoutIfNeeded() - }) { completed in + }) { _ in // Revert the content adjustment behavior self.messageTextView.contentInsetAdjustmentBehavior = .never @@ -568,7 +568,7 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { to: submissionOverlayView, duration: 0.25, options: [.showHideTransitionViews, .transitionCrossDissolve] - ) { success in + ) { _ in // success } } @@ -583,7 +583,7 @@ final class ProblemReportViewController: UIViewController, UITextFieldDelegate { to: scrollView, duration: 0.25, options: [.showHideTransitionViews, .transitionCrossDissolve] - ) { success in + ) { _ in // success self.submissionOverlayView.removeFromSuperview() } diff --git a/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceInteractor.swift b/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceInteractor.swift index b54108cca4..d734ee4459 100644 --- a/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceInteractor.swift +++ b/ios/MullvadVPN/View controllers/RevokedDevice/RevokedDeviceInteractor.swift @@ -22,7 +22,7 @@ final class RevokedDeviceInteractor { self.tunnelManager = tunnelManager let tunnelObserver = - TunnelBlockObserver(didUpdateTunnelStatus: { [weak self] manager, tunnelStatus in + TunnelBlockObserver(didUpdateTunnelStatus: { [weak self] _, tunnelStatus in self?.didUpdateTunnelStatus?(tunnelStatus) }) diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift index dc3700786b..8f07d64f71 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift @@ -62,7 +62,7 @@ final class LocationDataSource: UITableViewDiffableDataSource<Int, RelayLocation ) self.locationCellFactory = locationCellFactory - super.init(tableView: tableView) { tableView, indexPath, itemIdentifier in + super.init(tableView: tableView) { _, indexPath, itemIdentifier in locationCellFactory.makeCell(for: itemIdentifier, indexPath: indexPath) } diff --git a/ios/MullvadVPN/View controllers/SelectLocation/SelectLocationViewController.swift b/ios/MullvadVPN/View controllers/SelectLocation/SelectLocationViewController.swift index e2f00c37ee..c1e6a7f923 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/SelectLocationViewController.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/SelectLocationViewController.swift @@ -66,7 +66,7 @@ final class SelectLocationViewController: UIViewController { override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - coordinator.animate(alongsideTransition: nil) { context in + coordinator.animate(alongsideTransition: nil) { _ in guard let indexPath = self.dataSource?.indexPathForSelectedRelay() else { return } self.tableView.scrollToRow(at: indexPath, at: .middle, animated: false) diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift index 17947ea4c9..b2ee13f66c 100644 --- a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift +++ b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift @@ -59,7 +59,7 @@ final class SettingsDataSource: UITableViewDiffableDataSource< let settingsCellFactory = SettingsCellFactory(tableView: tableView, interactor: interactor) self.settingsCellFactory = settingsCellFactory - super.init(tableView: tableView) { tableView, indexPath, itemIdentifier in + super.init(tableView: tableView) { _, indexPath, itemIdentifier in settingsCellFactory.makeCell(for: itemIdentifier, indexPath: indexPath) } @@ -67,7 +67,7 @@ final class SettingsDataSource: UITableViewDiffableDataSource< registerClasses() updateDataSnapshot() - interactor.didUpdateDeviceState = { [weak self] deviceState in + interactor.didUpdateDeviceState = { [weak self] _ in self?.updateDataSnapshot() } storedAccountData = interactor.deviceState.accountData diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsInteractor.swift b/ios/MullvadVPN/View controllers/Settings/SettingsInteractor.swift index 7b35c4f8a4..01787f69c3 100644 --- a/ios/MullvadVPN/View controllers/Settings/SettingsInteractor.swift +++ b/ios/MullvadVPN/View controllers/Settings/SettingsInteractor.swift @@ -22,7 +22,7 @@ final class SettingsInteractor { self.tunnelManager = tunnelManager let tunnelObserver = - TunnelBlockObserver(didUpdateDeviceState: { [weak self] manager, deviceState, previousDeviceState in + TunnelBlockObserver(didUpdateDeviceState: { [weak self] _, deviceState, _ in self?.didUpdateDeviceState?(deviceState) }) diff --git a/ios/MullvadVPN/View controllers/Tunnel/TunnelViewController.swift b/ios/MullvadVPN/View controllers/Tunnel/TunnelViewController.swift index 39782ac20e..d6a31a96ff 100644 --- a/ios/MullvadVPN/View controllers/Tunnel/TunnelViewController.swift +++ b/ios/MullvadVPN/View controllers/Tunnel/TunnelViewController.swift @@ -56,7 +56,7 @@ class TunnelViewController: UIViewController, RootContainment { override func viewDidLoad() { super.viewDidLoad() - interactor.didUpdateDeviceState = { [weak self] deviceState, previousDeviceState in + interactor.didUpdateDeviceState = { [weak self] _, _ in self?.setNeedsHeaderBarStyleAppearanceUpdate() } diff --git a/ios/MullvadVPN/View controllers/Tunnel/TunnelViewControllerInteractor.swift b/ios/MullvadVPN/View controllers/Tunnel/TunnelViewControllerInteractor.swift index 2fa9381480..b29e924bcc 100644 --- a/ios/MullvadVPN/View controllers/Tunnel/TunnelViewControllerInteractor.swift +++ b/ios/MullvadVPN/View controllers/Tunnel/TunnelViewControllerInteractor.swift @@ -27,10 +27,10 @@ final class TunnelViewControllerInteractor { self.tunnelManager = tunnelManager let tunnelObserver = TunnelBlockObserver( - didUpdateTunnelStatus: { [weak self] tunnelManager, tunnelStatus in + didUpdateTunnelStatus: { [weak self] _, tunnelStatus in self?.didUpdateTunnelStatus?(tunnelStatus) }, - didUpdateDeviceState: { [weak self] tunnelManager, deviceState, previousDeviceState in + didUpdateDeviceState: { [weak self] _, deviceState, previousDeviceState in self?.didUpdateDeviceState?(deviceState, previousDeviceState) } ) diff --git a/ios/MullvadVPN/Views/CustomTextView.swift b/ios/MullvadVPN/Views/CustomTextView.swift index e30c657579..c9f43ed6d7 100644 --- a/ios/MullvadVPN/Views/CustomTextView.swift +++ b/ios/MullvadVPN/Views/CustomTextView.swift @@ -124,7 +124,7 @@ class CustomTextView: UITextView { forName: NSTextStorage.didProcessEditingNotification, object: textStorage, queue: OperationQueue.main - ) { [weak self] note in + ) { [weak self] _ in self?.updatePlaceholderVisibility() } diff --git a/ios/MullvadVPNTests/DeviceCheckOperationTests.swift b/ios/MullvadVPNTests/DeviceCheckOperationTests.swift index 07efc3a6e0..c80ebc0563 100644 --- a/ios/MullvadVPNTests/DeviceCheckOperationTests.swift +++ b/ios/MullvadVPNTests/DeviceCheckOperationTests.swift @@ -22,7 +22,7 @@ class DeviceCheckOperationTests: XCTestCase { let currentKey = PrivateKey() let remoteService = MockRemoteService( initialKey: currentKey.publicKey, - getAccount: { accountNumber in + getAccount: { _ in Account.mock(expiry: .distantPast) } ) @@ -53,7 +53,7 @@ class DeviceCheckOperationTests: XCTestCase { let remoteService = MockRemoteService( initialKey: currentKey.publicKey, - getAccount: { accountNumber in + getAccount: { _ in throw REST.Error.unhandledResponse(404, REST.ServerErrorResponse(code: .invalidAccount)) } ) @@ -84,7 +84,7 @@ class DeviceCheckOperationTests: XCTestCase { let remoteService = MockRemoteService( initialKey: currentKey.publicKey, - getDevice: { accountNumber, deviceIdentifier in + getDevice: { _, _ in throw REST.Error.unhandledResponse(404, REST.ServerErrorResponse(code: .deviceNotFound)) } ) @@ -245,7 +245,7 @@ class DeviceCheckOperationTests: XCTestCase { let nextKey = PrivateKey() let remoteService = MockRemoteService( - rotateDeviceKey: { accountNumber, identifier, publicKey in + rotateDeviceKey: { _, _, _ in throw URLError(.badURL) } ) @@ -280,7 +280,7 @@ class DeviceCheckOperationTests: XCTestCase { ) let remoteService = MockRemoteService( - rotateDeviceKey: { accountNumber, identifier, publicKey in + rotateDeviceKey: { _, _, _ in // Overwrite device state before returning the result from key rotation to simulate the race condition // in the underlying storage. try deviceStateAccessor.write( diff --git a/ios/OperationsTests/AsyncResultBlockOperationTests.swift b/ios/OperationsTests/AsyncResultBlockOperationTests.swift index 6c157725c4..4efbeb02c4 100644 --- a/ios/OperationsTests/AsyncResultBlockOperationTests.swift +++ b/ios/OperationsTests/AsyncResultBlockOperationTests.swift @@ -20,7 +20,7 @@ final class AsyncResultBlockOperationTests: XCTestCase { finish(.success(true)) } - operation.onFinish { op, error in + operation.onFinish { op, _ in XCTAssertEqual(op.result?.value, true) expectation.fulfill() } diff --git a/ios/OperationsTests/OperationConditionTests.swift b/ios/OperationsTests/OperationConditionTests.swift index 27898ea424..3e36adbf5c 100644 --- a/ios/OperationsTests/OperationConditionTests.swift +++ b/ios/OperationsTests/OperationConditionTests.swift @@ -18,7 +18,7 @@ class OperationConditionTests: XCTestCase { expectOperationToExecute.fulfill() } - let blockCondition = BlockCondition { op, completion in + let blockCondition = BlockCondition { _, completion in expectConditionEvaluation.fulfill() completion(true) } @@ -42,7 +42,7 @@ class OperationConditionTests: XCTestCase { expectOperationToNeverExecute.fulfill() } - let blockCondition = BlockCondition { op, completion in + let blockCondition = BlockCondition { _, completion in expectConditionEvaluation.fulfill() completion(false) } diff --git a/ios/OperationsTests/OperationObserverTests.swift b/ios/OperationsTests/OperationObserverTests.swift index de334be21a..9b05cc0c0d 100644 --- a/ios/OperationsTests/OperationObserverTests.swift +++ b/ios/OperationsTests/OperationObserverTests.swift @@ -19,13 +19,13 @@ class OperationObserverTests: XCTestCase { let operation = AsyncBlockOperation {} operation.addBlockObserver(OperationBlockObserver( - didAttach: { op in + didAttach: { _ in expectDidAttach.fulfill() - }, didStart: { op in + }, didStart: { _ in expectDidStart.fulfill() - }, didCancel: { op in + }, didCancel: { _ in expectDidCancel.fulfill() - }, didFinish: { op, error in + }, didFinish: { _, _ in expectDidFinish.fulfill() } )) @@ -46,13 +46,13 @@ class OperationObserverTests: XCTestCase { let operation = AsyncBlockOperation {} operation.addBlockObserver(OperationBlockObserver( - didAttach: { op in + didAttach: { _ in expectDidAttach.fulfill() - }, didStart: { op in + }, didStart: { _ in expectDidStart.fulfill() - }, didCancel: { op in + }, didCancel: { _ in expectDidCancel.fulfill() - }, didFinish: { op, error in + }, didFinish: { _, _ in expectDidFinish.fulfill() } )) diff --git a/ios/PacketTunnelCore/Pinger/Pinger.swift b/ios/PacketTunnelCore/Pinger/Pinger.swift index e9a960a102..8f220f38b6 100644 --- a/ios/PacketTunnelCore/Pinger/Pinger.swift +++ b/ios/PacketTunnelCore/Pinger/Pinger.swift @@ -65,7 +65,7 @@ public final class Pinger: PingerProtocol { SOCK_DGRAM, IPPROTO_ICMP, CFSocketCallBackType.readCallBack.rawValue, - { socket, callbackType, address, data, info in + { socket, callbackType, _, _, info in guard let socket, let info, callbackType == .readCallBack else { return } diff --git a/ios/PacketTunnelCoreTests/TunnelMonitorTests.swift b/ios/PacketTunnelCoreTests/TunnelMonitorTests.swift index f5a9559a4a..e85a50617c 100644 --- a/ios/PacketTunnelCoreTests/TunnelMonitorTests.swift +++ b/ios/PacketTunnelCoreTests/TunnelMonitorTests.swift @@ -18,7 +18,7 @@ final class TunnelMonitorTests: XCTestCase { let connectionLostExpectation = expectation(description: "Should not report connection loss") connectionLostExpectation.isInverted = true - let pinger = MockPinger(networkStatsReporting: networkCounters) { destination, sequence in + let pinger = MockPinger(networkStatsReporting: networkCounters) { _, _ in return .sendReply() } @@ -49,7 +49,7 @@ final class TunnelMonitorTests: XCTestCase { func testInitialConnectionTimings() { // Setup pinger so that it never receives any replies. - let pinger = MockPinger(networkStatsReporting: networkCounters) { destination, sequence in + let pinger = MockPinger(networkStatsReporting: networkCounters) { _, _ in return .ignore } diff --git a/ios/RelaySelector/RelaySelector.swift b/ios/RelaySelector/RelaySelector.swift index 558c81452c..db7607deab 100644 --- a/ios/RelaySelector/RelaySelector.swift +++ b/ios/RelaySelector/RelaySelector.swift @@ -302,12 +302,12 @@ protocol AnyRelay { extension REST.ServerRelay: AnyRelay {} extension REST.BridgeRelay: AnyRelay {} -fileprivate struct RelayWithLocation<T: AnyRelay> { +private struct RelayWithLocation<T: AnyRelay> { let relay: T let serverLocation: Location } -fileprivate struct RelayWithDistance<T: AnyRelay> { +private struct RelayWithDistance<T: AnyRelay> { let relay: T let distance: Double } diff --git a/ios/TunnelObfuscationTests/TCPConnection.swift b/ios/TunnelObfuscationTests/TCPConnection.swift index 85a26ff970..64c4e2a77d 100644 --- a/ios/TunnelObfuscationTests/TCPConnection.swift +++ b/ios/TunnelObfuscationTests/TCPConnection.swift @@ -59,7 +59,7 @@ class TCPConnection { nwConnection.receive( minimumIncompleteLength: minimumLength, maximumLength: maximumLength - ) { content, contentContext, isComplete, error in + ) { content, _, isComplete, error in if let error { continuation.resume(throwing: error) } else if let content { |
