style: format port guardian
This commit is contained in:
@@ -333,8 +333,13 @@ actor PortGuardian {
|
|||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
extension PortGuardian {
|
extension PortGuardian {
|
||||||
static func _testParseListeners(_ text: String) -> [(pid: Int32, command: String, fullCommand: String, user: String?)] {
|
static func _testParseListeners(_ text: String) -> [(
|
||||||
Self.parseListeners(from: text).map { ($0.pid, $0.command, $0.fullCommand, $0.user) }
|
pid: Int32,
|
||||||
|
command: String,
|
||||||
|
fullCommand: String,
|
||||||
|
user: String?)]
|
||||||
|
{
|
||||||
|
self.parseListeners(from: text).map { ($0.pid, $0.command, $0.fullCommand, $0.user) }
|
||||||
}
|
}
|
||||||
|
|
||||||
static func _testBuildReport(
|
static func _testBuildReport(
|
||||||
@@ -342,7 +347,11 @@ extension PortGuardian {
|
|||||||
mode: AppState.ConnectionMode,
|
mode: AppState.ConnectionMode,
|
||||||
listeners: [(pid: Int32, command: String, fullCommand: String, user: String?)]) -> PortReport
|
listeners: [(pid: Int32, command: String, fullCommand: String, user: String?)]) -> PortReport
|
||||||
{
|
{
|
||||||
let mapped = listeners.map { Listener(pid: $0.pid, command: $0.command, fullCommand: $0.fullCommand, user: $0.user) }
|
let mapped = listeners.map { Listener(
|
||||||
|
pid: $0.pid,
|
||||||
|
command: $0.command,
|
||||||
|
fullCommand: $0.fullCommand,
|
||||||
|
user: $0.user) }
|
||||||
return Self.buildReport(port: port, listeners: mapped, mode: mode)
|
return Self.buildReport(port: port, listeners: mapped, mode: mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user