Skip to content

Commit c7e2cda

Browse files
authored
Updating error type to use computed properties (#559)
1 parent 20a0f2a commit c7e2cda

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11

22
public struct ConnectionPoolError: Error, Hashable {
3-
enum Base: Error, Hashable {
3+
@usableFromInline
4+
enum Base: Error, Hashable, Sendable {
45
case requestCancelled
56
case poolShutdown
67
}
78

8-
private let base: Base
9+
@usableFromInline
10+
let base: Base
911

12+
@inlinable
1013
init(_ base: Base) { self.base = base }
1114

1215
/// The connection requests got cancelled
13-
public static let requestCancelled = ConnectionPoolError(.requestCancelled)
16+
@inlinable
17+
public static var requestCancelled: Self {
18+
ConnectionPoolError(.requestCancelled)
19+
}
1420
/// The connection requests can't be fulfilled as the pool has already been shutdown
15-
public static let poolShutdown = ConnectionPoolError(.poolShutdown)
21+
@inlinable
22+
public static var poolShutdown: Self {
23+
ConnectionPoolError(.poolShutdown)
24+
}
1625
}

0 commit comments

Comments
 (0)