Skip to content

Commit

Permalink
remove importing namespaces partially
Browse files Browse the repository at this point in the history
  • Loading branch information
mojganii committed Nov 14, 2023
1 parent c99d3c9 commit ae565a7
Show file tree
Hide file tree
Showing 33 changed files with 35 additions and 55 deletions.
3 changes: 1 addition & 2 deletions ios/MullvadREST/RESTAPIProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import Foundation
import MullvadTypes
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

public protocol APIQuerying {
func getAddressList(
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadREST/RESTDevicesProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import Foundation
import MullvadTypes
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

public protocol DeviceHandling {
func getDevice(
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadREST/ServerRelaysResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import Foundation
import MullvadTypes
import struct Network.IPv4Address
import struct Network.IPv6Address
import Network

extension REST {
public struct ServerLocation: Codable, Equatable {
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadSettings/DNSSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation
import MullvadTypes
import struct Network.IPv4Address
import Network

/// A struct describing Mullvad DNS blocking options.
public struct DNSBlockingOptions: OptionSet, Codable {
Expand Down
6 changes: 2 additions & 4 deletions ios/MullvadSettings/TunnelSettingsV1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import Foundation
import MullvadREST
import MullvadTypes
import struct Network.IPv4Address
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import Network
import WireGuardKitTypes

/// A struct that holds the configuration passed via `NETunnelProviderProtocol`.
public struct TunnelSettingsV1: Codable, Equatable, TunnelSettings {
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadTypes/IPv4Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import struct Network.IPv4Address
import Network

public struct IPv4Endpoint: Hashable, Equatable, Codable, CustomStringConvertible {
public let ip: IPv4Address
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadTypes/IPv6Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import struct Network.IPv6Address
import Network

public struct IPv6Endpoint: Hashable, Equatable, Codable, CustomStringConvertible {
public let ip: IPv6Address
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadTypes/Location.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2020 Mullvad VPN AB. All rights reserved.
//

import struct CoreLocation.CLLocationCoordinate2D
import CoreLocation
import Foundation

public struct Location: Codable, Equatable {
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadTypes/MullvadEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
//

import Foundation
import struct Network.IPv4Address
import struct Network.IPv6Address
import Network

/// Contains server data needed to connect to a single mullvad endpoint.
public struct MullvadEndpoint: Equatable, Codable {
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadTypes/RESTTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
//

import Foundation
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

public struct Account: Codable, Equatable {
public let id: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import MullvadREST
import MullvadSettings
import MullvadTransport
import MullvadTypes
import enum NetworkExtension.NEProviderStopReason
import NetworkExtension
import PacketTunnelCore
import RelayCache
import RelaySelector
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPN/TunnelManager/RotateKeyOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import MullvadREST
import MullvadSettings
import MullvadTypes
import Operations
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

class RotateKeyOperation: ResultOperation<Void> {
private let logger = Logger(label: "RotateKeyOperation")
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadVPN/TunnelManager/SetAccountOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import MullvadREST
import MullvadSettings
import MullvadTypes
import Operations
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

enum SetAccountAction {
/// Set new account.
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPN/TunnelManager/TunnelManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import RelayCache
import RelaySelector
import StoreKit
import UIKit
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/// Interval used for periodic polling of tunnel relay status when tunnel is establishing
/// connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import MullvadREST
import MullvadSettings
import MullvadTypes
import Operations
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

class UpdateDeviceDataOperation: ResultOperation<StoredDeviceData> {
private let interactor: TunnelInteractor
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadVPN/TunnelManager/WgKeyRotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import Foundation
import MullvadSettings
import MullvadTypes
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/**
Implements manipulations related to marking the beginning and the completion of key rotation, private key creation and other tasks relevant to handling the state of
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPNScreenshots/SnapshotHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ open class Snapshot: NSObject {
let format = UIGraphicsImageRendererFormat()
format.scale = image.scale
let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
return renderer.image { context in
return renderer.image { _ in
image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion ios/MullvadVPNTests/AddressCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@testable import MullvadREST
import MullvadTypes
import struct Network.IPv4Address
import Network
import XCTest

final class AddressCacheTests: XCTestCase {
Expand Down
3 changes: 1 addition & 2 deletions ios/MullvadVPNTests/WgKeyRotationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import MullvadSettings
import MullvadTypes
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes
import XCTest

final class WgKeyRotationTests: XCTestCase {
Expand Down
3 changes: 1 addition & 2 deletions ios/PacketTunnel/DeviceCheck/DeviceCheckOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import MullvadSettings
import MullvadTypes
import Operations
import PacketTunnelCore
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/**
An operation that is responsible for performing account and device diagnostics and key rotation from within packet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import MullvadREST
import MullvadTypes
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/// An object that implements remote service used by `DeviceCheckOperation`.
struct DeviceCheckRemoteService: DeviceCheckRemoteServiceProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation
import MullvadTypes
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/// A protocol that formalizes remote service dependency used by `DeviceCheckOperation`.
protocol DeviceCheckRemoteServiceProtocol {
Expand Down
6 changes: 2 additions & 4 deletions ios/PacketTunnelCore/Actor/ConfigurationBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import Foundation
import MullvadTypes
import protocol Network.IPAddress
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import Network
import WireGuardKitTypes

/// Error returned when there is an endpoint but its public key is invalid.
public struct PublicKeyError: LocalizedError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

extension PacketTunnelActor {
/**
Expand Down
2 changes: 1 addition & 1 deletion ios/PacketTunnelCore/Actor/PacketTunnelActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import MullvadLogging
import MullvadTypes
import NetworkExtension
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

/**
Packet tunnel state machine implemented as an actor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import Foundation
import MullvadTypes
import Network

import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import class WireGuardKitTypes.PublicKey
import WireGuardKitTypes

/// Protocol describing interface for any kind of adapter implementing a VPN tunnel.
public protocol TunnelAdapterProtocol {
Expand Down
2 changes: 1 addition & 1 deletion ios/PacketTunnelCore/Actor/State+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation
import MullvadTypes
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

extension State {
/// Returns the target state to which the actor state should transition when requested to reconnect.
Expand Down
2 changes: 1 addition & 1 deletion ios/PacketTunnelCore/Actor/State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import MullvadTypes
import TunnelObfuscation
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

/**
Tunnel actor state with metadata describing the current phase of packet tunnel lifecycle.
Expand Down
4 changes: 1 addition & 3 deletions ios/PacketTunnelCore/Pinger/Pinger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
//

import Foundation
import protocol Network.IPAddress
import struct Network.IPv4Address
import struct Network.IPv6Address
import Network

/// ICMP client.
public final class Pinger: PingerProtocol {
Expand Down
3 changes: 1 addition & 2 deletions ios/PacketTunnelCore/TunnelMonitor/TunnelMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import Foundation
import MullvadLogging
import MullvadTypes
import protocol Network.IPAddress
import struct Network.IPv4Address
import Network

/// Tunnel monitor.
public final class TunnelMonitor: TunnelMonitorProtocol {
Expand Down
2 changes: 1 addition & 1 deletion ios/PacketTunnelCoreTests/Mocks/RelaySelectorStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation
import MullvadTypes
import PacketTunnelCore
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

/// Relay selector stub that accepts a block that can be used to provide custom implementation.
struct RelaySelectorStub: RelaySelectorProtocol {
Expand Down
3 changes: 1 addition & 2 deletions ios/PacketTunnelCoreTests/Mocks/SettingsReaderStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import Foundation
import MullvadTypes
import PacketTunnelCore
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes

/// Settings reader stub that can be configured with a block to provide the desired behavior when testing.
struct SettingsReaderStub: SettingsReaderProtocol {
Expand Down
3 changes: 1 addition & 2 deletions ios/PacketTunnelCoreTests/PacketTunnelActorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import MullvadTypes
import Network
@testable import PacketTunnelCore
@testable import RelaySelector
import struct WireGuardKitTypes.IPAddressRange
import class WireGuardKitTypes.PrivateKey
import WireGuardKitTypes
import XCTest

final class PacketTunnelActorTests: XCTestCase {
Expand Down

0 comments on commit ae565a7

Please sign in to comment.