Swift cleanup: don't capture case values only to ignore them in switch statements

Signed-off-by: Bryan Montz <bryanmontz@me.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Bryan Montz
2023-07-16 08:00:53 -05:00
committed by William Casarin
parent 3d6909bf62
commit 6bf5293701
7 changed files with 28 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ enum NostrResponse: Decodable {
var subid: String? {
switch self {
case .ok(_):
case .ok:
return nil
case .event(let sub_id, _):
return sub_id

View File

@@ -18,7 +18,7 @@ enum WebSocketEvent {
switch self {
case .connected:
return "Connected"
case .message(_):
case .message:
return nil // adding this to the RelayLog was too noisy
case .disconnected(let close_code, let reason):
return "Disconnected: Close code: \(close_code), reason: \(reason ?? "unknown")"