From 0e2d9cbb553aba8b9a8acf3d56d1bf042360855f Mon Sep 17 00:00:00 2001 From: Stuart Montgomery Date: Fri, 28 Jun 2024 08:06:44 -0500 Subject: [PATCH] Remove an obsolete workaround for Result.get() (#509) --- .../Testing/Support/Additions/ResultAdditions.swift | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Sources/Testing/Support/Additions/ResultAdditions.swift b/Sources/Testing/Support/Additions/ResultAdditions.swift index dbc19100..4607fc82 100644 --- a/Sources/Testing/Support/Additions/ResultAdditions.swift +++ b/Sources/Testing/Support/Additions/ResultAdditions.swift @@ -13,20 +13,13 @@ extension Result { /// /// - Warning: This function is used to implement the `#expect()` and /// `#require()` macros. Do not call it directly. - public func __expected() {} + @inlinable public func __expected() {} /// Handle this instance as if it were returned from a call to `#require()`. /// /// - Warning: This function is used to implement the `#expect()` and /// `#require()` macros. Do not call it directly. - public func __required() throws -> Success { - /// `get()` is current broken in the Swift standard library, so switch - /// manually to work around the problem. ([122797397](rdar://122797397)) - switch self { - case let .success(result): - return result - case let .failure(error): - throw error - } + @inlinable public func __required() throws -> Success { + try get() } }