Skip to content

Commit 9d39799

Browse files
committed
updating error type to use computed properties
1 parent 02f74ca commit 9d39799

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
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+
public static var requestCancelled: Self {
17+
ConnectionPoolError(.requestCancelled)
18+
}
1419
/// The connection requests can't be fulfilled as the pool has already been shutdown
15-
public static let poolShutdown = ConnectionPoolError(.poolShutdown)
20+
public static var poolShutdown: Self {
21+
ConnectionPoolError(.poolShutdown)
22+
}
1623
}

0 commit comments

Comments
 (0)