Skip to content

Commit 03604ff

Browse files
committed
Use typed error instead of rethrows
1 parent 2d0912a commit 03604ff

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Sources/System/IORing/RawIORequest.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,20 +176,20 @@ extension RawIORequest {
176176
}
177177

178178
@inlinable
179-
static func withTimeoutRequest<R>(
179+
static func withTimeoutRequest<R, E: Error>(
180180
linkedTo opEntry: UnsafeMutablePointer<swift_io_uring_sqe>,
181181
in timeoutEntry: UnsafeMutablePointer<swift_io_uring_sqe>,
182-
duration: Duration,
183-
flags: TimeOutFlags,
184-
work: () throws -> R) rethrows -> R {
182+
duration: Duration,
183+
flags: TimeOutFlags,
184+
work: () throws(E) -> R) throws(E) -> R {
185185

186186
opEntry.pointee.flags |= Flags.linkRequest.rawValue
187187
opEntry.pointee.off = 1
188188
var ts = timespec(
189-
tv_sec: Int(duration.components.seconds),
189+
tv_sec: Int(duration.components.seconds),
190190
tv_nsec: Int(duration.components.attoseconds / 1_000_000_000)
191191
)
192-
return try withUnsafePointer(to: &ts) { tsPtr in
192+
return try withUnsafePointer(to: &ts) { tsPtr throws(E) -> R in
193193
var req: RawIORequest = RawIORequest()
194194
req.operation = .link_timeout
195195
req.rawValue.timeout_flags = flags.rawValue

0 commit comments

Comments
 (0)