@@ -17,8 +17,8 @@ private import FirebaseCoreInternal
17
17
18
18
/// Async API for interacting with web sockets.
19
19
///
20
- /// Internally, this just wraps around a `URLSessionWebSocketTask`, and provides a more async friendly
21
- /// interface for sending and consuming data from it.
20
+ /// Internally, this just wraps around a `URLSessionWebSocketTask`, and provides a more async
21
+ /// friendly interface for sending and consuming data from it.
22
22
///
23
23
/// Also surfaces a more fine-grained ``WebSocketClosedError`` for when the web socket is closed.
24
24
final class AsyncWebSocket : NSObject , @unchecked Sendable , URLSessionWebSocketDelegate {
@@ -85,11 +85,9 @@ final class AsyncWebSocket: NSObject, @unchecked Sendable, URLSessionWebSocketDe
85
85
}
86
86
}
87
87
88
- private func close(
89
- code: URLSessionWebSocketTask . CloseCode ,
90
- reason: Data ? ,
91
- underlyingError: Error ? = nil
92
- ) {
88
+ private func close( code: URLSessionWebSocketTask . CloseCode ,
89
+ reason: Data ? ,
90
+ underlyingError: Error ? = nil ) {
93
91
let error = WebSocketClosedError (
94
92
closeCode: code,
95
93
closeReason: reason,
@@ -134,7 +132,8 @@ struct WebSocketClosedError: Error, Sendable, CustomNSError {
134
132
let closeReason : String
135
133
let underlyingError : Error ?
136
134
137
- init ( closeCode: URLSessionWebSocketTask . CloseCode , closeReason: Data ? , underlyingError: Error ? = nil ) {
135
+ init ( closeCode: URLSessionWebSocketTask . CloseCode , closeReason: Data ? ,
136
+ underlyingError: Error ? = nil ) {
138
137
self . closeCode = closeCode
139
138
self . closeReason = closeReason
140
139
. flatMap { String ( data: $0, encoding: . utf8) } ?? " Unknown reason. "
0 commit comments