From 3eb5381828d21dfe2c042b253167de812489f594 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Tue, 18 May 2021 13:11:25 -0400 Subject: [PATCH] Remove TODOs that were actually done (#392) --- .../amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt | 1 - .../amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt | 1 - .../rust/codegen/smithy/customize/NamedSectionGenerator.kt | 3 --- .../smithy/rust/codegen/smithy/generators/EnumGenerator.kt | 1 - .../rust/codegen/smithy/generators/HttpProtocolGenerator.kt | 1 - .../smithy/generators/http/RequestBindingGenerator.kt | 6 ------ .../smithy/rust/codegen/smithy/protocols/AwsRestJson.kt | 1 - .../smithy/rust/codegen/smithy/protocols/ProtocolLoader.kt | 2 -- .../rust/codegen/smithy/generators/InstantiatorTest.kt | 2 -- 9 files changed, 18 deletions(-) diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt index 12b809a70..1c524be42 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt @@ -82,7 +82,6 @@ class CodegenVisitor(context: PluginContext, private val codegenDecorator: RustC val serviceShapes = Walker(model).walkShapes(service) serviceShapes.forEach { it.accept(this) } codegenDecorator.extras(protocolConfig, rustCrate) - // TODO: if we end up with a lot of these on-by-default customizations, we may want to refactor them somewhere rustCrate.finalize( settings, codegenDecorator.libRsCustomizations( diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt index 69e65492f..cabcb74e5 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt @@ -198,7 +198,6 @@ class SymbolVisitor( override fun setShape(shape: SetShape): Symbol { val inner = this.toSymbol(shape.member) val builder = if (model.expectShape(shape.member.target).isStringShape) { - // TODO: refactor / figure out how we want to handle prebaked symbols symbolBuilder(shape, RustType.HashSet(inner.rustType())) } else { // only strings get put into actual sets because floats are unhashable diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt index be51ca5af..8f6c4b1f6 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/customize/NamedSectionGenerator.kt @@ -27,9 +27,6 @@ abstract class Section(val name: String) * 1. Override section and use a `when` clause to handle each section individually * 2. Call `registerSection { ... }` to register individual sections on demand. * - * TODO: Factory for creating named-section generators from ProtocolConfig - * - * TODO: Enable using partials as a named section generator to allow defining insertions from inlineable Rust code: * ```rust * struct Config { * /* section:ConfigStruct */ diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt index 0b526517e..bb2b75b9b 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt @@ -100,7 +100,6 @@ class EnumGenerator( } private fun implBlock() { - // TODO: should enums also implement AsRef? writer.rustBlock("impl $enumName") { writer.rustBlock("pub fn as_str(&self) -> &str") { writer.rustBlock("match self") { diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt index 7b18a16b8..f6a6430fa 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt @@ -78,7 +78,6 @@ abstract class HttpProtocolGenerator( inputWriter.implBlock(inputShape, symbolProvider) { buildOperation(this, operationShape, customizations, sdkId) toHttpRequestImpl(this, operationShape, inputShape) - // TODO: streaming shapes need special support rustBlock( "fn assemble(mut builder: #1T, body: #3T) -> #2T<#3T>", RuntimeType.HttpRequestBuilder, diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/http/RequestBindingGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/http/RequestBindingGenerator.kt index b64c1d7c3..76fee3f29 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/http/RequestBindingGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/http/RequestBindingGenerator.kt @@ -39,7 +39,6 @@ fun HttpTrait.uriFormatString(): String { else -> it.content } } - // TODO: support query literals return base.dq() } @@ -51,11 +50,6 @@ fun HttpTrait.uriFormatString(): String { * * This method takes a builder (perhaps pre configured with some headers) from the caller and sets the HTTP * headers & URL based on the HTTP trait implementation. - * - * More work is required to implement the entirety of https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html - * Specifically: - * TODO: httpPrefixHeaders; 4h - * TODO: Deserialization of all fields; 1w */ class RequestBindingGenerator( val model: Model, diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt index a0da099af..85477e30f 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt @@ -57,7 +57,6 @@ class AwsRestJsonFactory : ProtocolGeneratorFactory } override fun support(): ProtocolSupport { - // TODO: Support body for RestJson return ProtocolSupport( requestSerialization = true, requestBodySerialization = true, diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/ProtocolLoader.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/ProtocolLoader.kt index e63812aa2..ee6615bfe 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/ProtocolLoader.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/ProtocolLoader.kt @@ -20,8 +20,6 @@ import software.amazon.smithy.rust.codegen.smithy.generators.ProtocolGeneratorFa typealias ProtocolMap = Map> -// typealias ProtocolMap = -// TODO: supportedProtocols must be runtime loadable via SPI; 2d class ProtocolLoader(private val supportedProtocols: ProtocolMap) { fun protocolFor( model: Model, diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/InstantiatorTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/InstantiatorTest.kt index 887a355ef..43a536ee4 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/InstantiatorTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/InstantiatorTest.kt @@ -71,8 +71,6 @@ class InstantiatorTest { private val symbolProvider = testSymbolProvider(model) private val runtimeConfig = TestRuntimeConfig - // TODO: test of recursive structures when supported - fun RustWriter.test(block: RustWriter.() -> Unit) { raw("#[test]") rustBlock("fn inst()") { -- GitLab