Skip to content

Commit 0e2d9cb

Browse files
authored
Remove an obsolete workaround for Result.get() (#509)
1 parent aacacd7 commit 0e2d9cb

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Sources/Testing/Support/Additions/ResultAdditions.swift

+3-10
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,13 @@ extension Result {
1313
///
1414
/// - Warning: This function is used to implement the `#expect()` and
1515
/// `#require()` macros. Do not call it directly.
16-
public func __expected() {}
16+
@inlinable public func __expected() {}
1717

1818
/// Handle this instance as if it were returned from a call to `#require()`.
1919
///
2020
/// - Warning: This function is used to implement the `#expect()` and
2121
/// `#require()` macros. Do not call it directly.
22-
public func __required() throws -> Success {
23-
/// `get()` is current broken in the Swift standard library, so switch
24-
/// manually to work around the problem. ([122797397](rdar://122797397))
25-
switch self {
26-
case let .success(result):
27-
return result
28-
case let .failure(error):
29-
throw error
30-
}
22+
@inlinable public func __required() throws -> Success {
23+
try get()
3124
}
3225
}

0 commit comments

Comments
 (0)