From c9d67d447b2cc17804bf9db6875a6af38ff1be51 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Fri, 10 Nov 2023 10:37:17 -0500 Subject: [PATCH] fix issue with IntoShared and cleanup change log --- CHANGELOG.next.toml | 49 +++++++++++++++++++ .../endpoint/EndpointConfigCustomization.kt | 2 - 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 638b7c6319..ba31b8f127 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -58,3 +58,52 @@ message = "Fix exclusively setting the credentials provider at operation config- references = ["smithy-rs#3156", "aws-sdk-rust#901"] meta = { "breaking" = false, "tada" = false, "bug" = true } author = "ysaito1001" + +[[smithy-rs]] +message = """Enable conversion from `BuildError` into `SdkError` & `::Error`. This allows customers to write the following code: +```rust +async fn do_a_thing(client: &Client) -> Result> { + client.run_operation().complex_field(ComplexField::builder() + .a("a") + .b("b") + .build()? + ).send().await?; +} +``` + +Previously, `?` could not be used in this position. +""" +references = ["smithy-rs#3173", "smithy-rs#3171"] +meta = { "breaking" = false, "tada" = true, "bug" = false } +author = "rcoh" + +[[aws-sdk-rust]] +message = """Enable conversion from `BuildError` into `SdkError` & `::Error`. This allows customers to write the following code: +```rust +async fn create_table(dynamo_client: &Client) -> Result<(), SdkError> { + dynamo_client + .create_table() + .table_name("test") + .key_schema( + KeySchemaElement::builder() + .attribute_name("year") + .key_type(KeyType::Hash) + .build()?, // Previously, `?` could not be used here + ) + .send() + .await?; + Ok(()) +} +``` + +Previously, `?` could not be used in this position. +""" +references = ["smithy-rs#3173", "smithy-rs#3171"] +meta = { "breaking" = false, "tada" = true, "bug" = false } +author = "rcoh" + +[[aws-sdk-rust]] +message = "ProvideCredentials and SharedCredentialsProvider are now re-exported." +references = ["smithy-rs#3173", "smithy-rs#3155"] +meta = { "breaking" = false, "tada" = false, "bug" = false } +author = "rcoh" diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointConfigCustomization.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointConfigCustomization.kt index e565aeefa9..f40f46284d 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointConfigCustomization.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/endpoint/EndpointConfigCustomization.kt @@ -32,7 +32,6 @@ internal class EndpointConfigCustomization( private val codegenScope = arrayOf( *preludeScope, "Params" to typesGenerator.paramsStruct(), - "IntoShared" to RuntimeType.smithyRuntimeApi(runtimeConfig).resolve("shared::IntoShared"), "Resolver" to RuntimeType.smithyRuntime(runtimeConfig).resolve("client::config_override::Resolver"), "SharedEndpointResolver" to epModule.resolve("SharedEndpointResolver"), "StaticUriEndpointResolver" to epRuntimeModule.resolve("StaticUriEndpointResolver"), @@ -90,7 +89,6 @@ internal class EndpointConfigCustomization( ##[allow(deprecated)] self.set_endpoint_resolver( endpoint_url.map(|url| { - use #{IntoShared}; #{StaticUriEndpointResolver}::uri(url).into_shared() }) );