Unverified Commit 38375a5a authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Address some trivial TODO comments (#3040)

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 441b05d5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -382,8 +382,6 @@ class ResiliencyServiceRuntimePluginCustomization(codegenContext: ClientCodegenC
    override fun section(section: ServiceRuntimePluginSection): Writable = writable {
        when (section) {
            is ServiceRuntimePluginSection.DeclareSingletons -> {
                // TODO(enableNewSmithyRuntimeCleanup) We can use the standard library's `OnceCell` once we upgrade the
                //    MSRV to 1.70
                rustTemplate(
                    """
                    static TOKEN_BUCKET: #{StaticPartitionMap}<#{TokenBucketPartition}, #{TokenBucket}> = #{StaticPartitionMap}::new();
+4 −8
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import software.amazon.smithy.rust.codegen.client.smithy.generators.OperationCus
import software.amazon.smithy.rust.codegen.client.smithy.generators.ServiceRuntimePluginCustomization
import software.amazon.smithy.rust.codegen.client.smithy.generators.config.ConfigCustomization
import software.amazon.smithy.rust.codegen.core.rustlang.Feature
import software.amazon.smithy.rust.codegen.core.rustlang.rust
import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate
import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType
import software.amazon.smithy.rust.codegen.core.smithy.RustCrate
@@ -86,20 +85,17 @@ class RequiredCustomizations : ClientCodegenDecorator {
            pubUseSmithyPrimitives(codegenContext, codegenContext.model)(this)
        }
        rustCrate.withModule(ClientRustModule.Error) {
            // TODO(enableNewSmithyRuntimeCleanup): Change SdkError to a `pub use` after changing the generic's default
            rust("/// Error type returned by the client.")
            rustTemplate(
                "pub type SdkError<E, R = #{R}> = #{SdkError}<E, R>;",
                "SdkError" to RuntimeType.sdkError(rc),
                "R" to RuntimeType.smithyRuntimeApi(rc).resolve("client::orchestrator::HttpResponse"),
            )
            rustTemplate(
                """
                /// Error type returned by the client.
                pub use #{SdkError};

                pub use #{DisplayErrorContext};
                pub use #{ProvideErrorMetadata};
                """,
                "DisplayErrorContext" to RuntimeType.smithyTypes(rc).resolve("error::display::DisplayErrorContext"),
                "ProvideErrorMetadata" to RuntimeType.smithyTypes(rc).resolve("error::metadata::ProvideErrorMetadata"),
                "SdkError" to RuntimeType.sdkError(rc),
            )
        }

+0 −2
Original line number Diff line number Diff line
@@ -73,10 +73,8 @@ class EndpointTraitBindings(
                    }
                    if (generateValidation) {
                        val contents =
                            // TODO(enableNewSmithyRuntimeCleanup): Remove the allow attribute once all places need .into method
                            """
                            if $field.is_empty() {
                                ##[allow(clippy::useless_conversion)]
                                return Err(#{invalidFieldError:W}.into())
                            }
                            """