mirror of
https://github.com/kkebo/DNSecure.git
synced 2026-03-11 08:54:36 +00:00
Merge pull request #137 from kkebo/refactor-with-switch-expressions
This commit is contained in:
commit
47c4f34d32
3 changed files with 12 additions and 22 deletions
|
|
@ -10,16 +10,11 @@ import NetworkExtension
|
|||
extension NEOnDemandRuleAction: @retroactive CustomStringConvertible {
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .connect:
|
||||
return "Apply settings"
|
||||
case .disconnect:
|
||||
return "Do not apply settings"
|
||||
case .evaluateConnection:
|
||||
return "Apply with excluded domains"
|
||||
case .ignore:
|
||||
return "As is"
|
||||
default:
|
||||
return "Unknown"
|
||||
case .connect: "Apply settings"
|
||||
case .disconnect: "Do not apply settings"
|
||||
case .evaluateConnection: "Apply with excluded domains"
|
||||
case .ignore: "As is"
|
||||
@unknown case _: "Unknown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ import NetworkExtension
|
|||
extension NEOnDemandRuleInterfaceType: @retroactive CaseIterable {
|
||||
public static var allCases: [Self] {
|
||||
#if os(macOS)
|
||||
return [.any, .ethernet, .wiFi]
|
||||
[.any, .ethernet, .wiFi]
|
||||
#else
|
||||
return [.any, .wiFi, .cellular]
|
||||
[.any, .wiFi, .cellular]
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,20 +10,15 @@ import NetworkExtension
|
|||
extension NEOnDemandRuleInterfaceType: @retroactive CustomStringConvertible {
|
||||
public var description: String {
|
||||
switch self {
|
||||
case .any:
|
||||
return "Any"
|
||||
case .any: "Any"
|
||||
#if os(macOS)
|
||||
case .ethernet:
|
||||
return "Ethernet"
|
||||
case .ethernet: "Ethernet"
|
||||
#endif
|
||||
case .wiFi:
|
||||
return "Wi-Fi"
|
||||
case .wiFi: "Wi-Fi"
|
||||
#if os(iOS)
|
||||
case .cellular:
|
||||
return "Cellular"
|
||||
case .cellular: "Cellular"
|
||||
#endif
|
||||
default:
|
||||
return "Unknown"
|
||||
@unknown case _: "Unknown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue