Skip to content

Commit 17a1d0c

Browse files
committed
remove asStateMachineAction
1 parent f914380 commit 17a1d0c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP1StateMachine.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ extension HTTPConnectionPool {
208208
}
209209

210210
mutating func newHTTP1ConnectionEstablished(_ connection: Connection) -> Action {
211-
self._newHTTP1ConnectionEstablished(connection).asStateMachineAction
211+
.init(self._newHTTP1ConnectionEstablished(connection))
212212
}
213213

214214
private mutating func _newHTTP1ConnectionEstablished(_ connection: Connection) -> EstablishedAction {
@@ -285,7 +285,7 @@ extension HTTPConnectionPool {
285285

286286
mutating func http1ConnectionReleased(_ connectionID: Connection.ID) -> Action {
287287
let (index, context) = self.connections.releaseConnection(connectionID)
288-
return self.nextActionForIdleConnection(at: index, context: context).asStateMachineAction
288+
return .init(self.nextActionForIdleConnection(at: index, context: context))
289289
}
290290

291291
/// A connection has been unexpectedly closed

Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+HTTP2StateMachine.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ extension HTTPConnectionPool {
217217
}
218218

219219
mutating func newHTTP2ConnectionEstablished(_ connection: Connection, maxConcurrentStreams: Int) -> Action {
220-
self._newHTTP2ConnectionEstablished(connection, maxConcurrentStreams: maxConcurrentStreams).asStateMachineAction
220+
.init(self._newHTTP2ConnectionEstablished(connection, maxConcurrentStreams: maxConcurrentStreams))
221221
}
222222

223223
private mutating func _newHTTP2ConnectionEstablished(_ connection: Connection, maxConcurrentStreams: Int) -> EstablishedAction {
@@ -292,7 +292,7 @@ extension HTTPConnectionPool {
292292

293293
mutating func newHTTP2MaxConcurrentStreamsReceived(_ connectionID: Connection.ID, newMaxStreams: Int) -> Action {
294294
let (index, context) = self.connections.newHTTP2MaxConcurrentStreamsReceived(connectionID, newMaxStreams: newMaxStreams)
295-
return self.nextActionForAvailableConnection(at: index, context: context).asStateMachineAction
295+
return .init(self.nextActionForAvailableConnection(at: index, context: context))
296296
}
297297

298298
mutating func http2ConnectionGoAwayReceived(_ connectionID: Connection.ID) -> Action {
@@ -362,7 +362,7 @@ extension HTTPConnectionPool {
362362

363363
mutating func http2ConnectionStreamClosed(_ connectionID: Connection.ID) -> Action {
364364
let (index, context) = self.connections.releaseStream(connectionID)
365-
return self.nextActionForAvailableConnection(at: index, context: context).asStateMachineAction
365+
return .init(self.nextActionForAvailableConnection(at: index, context: context))
366366
}
367367

368368
mutating func failedToCreateNewConnection(_ error: Error, connectionID: Connection.ID) -> Action {

Sources/AsyncHTTPClient/ConnectionPool/State Machine/HTTPConnectionPool+StateMachine.swift

-4
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,6 @@ extension HTTPConnectionPool.StateMachine {
235235
static let none: Self = .init(request: .none, connection: .none)
236236
let request: HTTPConnectionPool.StateMachine.RequestAction
237237
let connection: EstablishedConnectionAction
238-
239-
var asStateMachineAction: HTTPConnectionPool.StateMachine.Action {
240-
return .init(self)
241-
}
242238
}
243239

244240
enum EstablishedConnectionAction {

0 commit comments

Comments
 (0)