Skip to content

Commit 20a8c34

Browse files
authored
Add PoolStateMachine.ConnectionState (#425)
1 parent 5641966 commit 20a8c34

File tree

5 files changed

+904
-25
lines changed

5 files changed

+904
-25
lines changed

Sources/ConnectionPoolModule/Max2Sequence.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ struct Max2Sequence<Element>: Sequence {
9090
}
9191
}
9292

93+
extension Max2Sequence: ExpressibleByArrayLiteral {
94+
@inlinable
95+
init(arrayLiteral elements: Element...) {
96+
precondition(elements.count <= 2)
97+
var iterator = elements.makeIterator()
98+
self.first = iterator.next()
99+
self.second = iterator.next()
100+
}
101+
}
102+
93103
extension Max2Sequence: Equatable where Element: Equatable {}
94104
extension Max2Sequence: Hashable where Element: Hashable {}
95105
extension Max2Sequence: Sendable where Element: Sendable {}

0 commit comments

Comments
 (0)