Skip to content

Commit

Permalink
Remove algorithmWasCloned
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Aug 16, 2023
1 parent 7b6c207 commit a2ea7fe
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,13 @@ private fun HttpChecksumTrait.requestAlgorithmMember(
private fun HttpChecksumTrait.checksumAlgorithmToStr(
codegenContext: ClientCodegenContext,
operationShape: OperationShape,
// TODO(enableNewSmithyRuntimeCleanup): Remove `algorithmWasCloned` (it should always be false)
algorithmWasCloned: Boolean,
): Writable {
val runtimeConfig = codegenContext.runtimeConfig
val requestAlgorithmMember = this.requestAlgorithmMember(codegenContext, operationShape)
val isRequestChecksumRequired = this.isRequestChecksumRequired

return {
if (requestAlgorithmMember != null) {
if (algorithmWasCloned) {
// User may set checksum for requests, and we need to call as_ref before we can convert the algorithm to a &str
rust("let checksum_algorithm = $requestAlgorithmMember.as_ref();")
}

if (isRequestChecksumRequired) {
// Checksums are required, fall back to MD5
rust("""let checksum_algorithm = checksum_algorithm.map(|algorithm| algorithm.as_str()).or(Some("md5"));""")
Expand Down Expand Up @@ -148,7 +141,6 @@ class HttpRequestChecksumCustomization(
"checksum_algorithm_to_str" to checksumTrait.checksumAlgorithmToStr(
codegenContext,
operationShape,
algorithmWasCloned = false,
),
)
}
Expand Down

0 comments on commit a2ea7fe

Please sign in to comment.