Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix compiler warnings #809

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SmithyHTTPAuth/SigV4Signer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class SigV4Signer: SmithyHTTPAuthAPI.Signer {
)
}

var signingConfig = try constructSigningConfig(identity: identity, signingProperties: signingProperties)
let signingConfig = try constructSigningConfig(identity: identity, signingProperties: signingProperties)

let unsignedRequest = requestBuilder.build()
let crtUnsignedRequest: HTTPRequestBase = isBidirectionalStreamingEnabled ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DefaultRetryStrategyTests: XCTestCase {

override func setUp() {
backoffStrategy = .init()
backoffStrategy.random = { 1.0 }
backoffStrategy.random = { @Sendable () -> Double in 1.0 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK why I have to explicitly mark these blocks as Sendable, this is a pretty easy case so the compiler must not do any auto-checking.

options = RetryStrategyOptions(backoffStrategy: backoffStrategy, maxRetriesBase: 2)
subject = DefaultRetryStrategy(options: options)
mockSleeper = { self.actualDelay = $0 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ final class ExponentialBackoffStrategyTests: XCTestCase {
override func setUp() {
subject = ExponentialBackoffStrategy()
// Randomization is disabled to allow easy, repeatable verification of basic behavior.
subject.random = { 1.0 }
subject.random = { @Sendable () -> Double in 1.0 }
}

func test_backoffStrategy_multipliesByBackoffFactor() {
subject.random = { 0.25 }
subject.random = { @Sendable () -> Double in 0.25 }
XCTAssertEqual(subject.computeNextBackoffDelay(attempt: 0), 0.25)
subject.random = { 0.5 }
subject.random = { @Sendable () -> Double in 0.5 }
XCTAssertEqual(subject.computeNextBackoffDelay(attempt: 0), 0.5)
subject.random = { 0.75 }
subject.random = { @Sendable () -> Double in 0.75 }
XCTAssertEqual(subject.computeNextBackoffDelay(attempt: 0), 0.75)
}

Expand Down
Loading