Skip to content

Commit 97d3da0

Browse files
authored
fix(build): update code to build for xcode 15.3 beta 2 (#3506)
1 parent ce67d1c commit 97d3da0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/Support/Internal/Attempt.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Foundation
1313
/// - fail: error handler
1414
/// - Returns: optional result
1515
func attempt<T>(_ expression: @autoclosure () throws -> T,
16-
fail: @autoclosure () -> ((Swift.Error) -> Void) = { _ in }) -> T? {
16+
fail: @autoclosure () -> ((Swift.Error) -> Void)) -> T? {
1717
do {
1818
return try expression()
1919
} catch {
@@ -29,7 +29,7 @@ func attempt<T>(_ expression: @autoclosure () throws -> T,
2929
/// - Returns: success
3030
@discardableResult
3131
func attempt(_ expression: @autoclosure () throws -> Void,
32-
fail: @autoclosure () -> ((Swift.Error) -> Void) = { _ in }) -> Bool {
32+
fail: @autoclosure () -> ((Swift.Error) -> Void)) -> Bool {
3333
do {
3434
try expression()
3535
return true

AmplifyPlugins/Storage/Tests/AWSS3StoragePluginTests/Support/Internal/AttemptTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ class AttemptTests: XCTestCase {
4848
}
4949

5050
func testAttemptNoFailClosureNoThrow() throws {
51-
let result = attempt(try work1(number: badNumber))
51+
let result = attempt(try work1(number: badNumber),
52+
fail: { error in })
5253
XCTAssertNil(result)
5354
}
5455

5556
func testAttemptNoFailClosureThrow() throws {
56-
let result = attempt(try work2(number: badNumber))
57+
let result = attempt(try work2(number: badNumber),
58+
fail: { error in })
5759
XCTAssertEqual(false, result)
5860
}
5961

0 commit comments

Comments
 (0)