Skip to content

Commit

Permalink
Associate #2396 with TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Feb 21, 2023
1 parent b3f5cbd commit 21c8fa4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import software.amazon.smithy.rust.codegen.core.smithy.rustType
import software.amazon.smithy.rust.codegen.core.util.toSnakeCase
import software.amazon.smithy.rust.codegen.server.smithy.ServerCodegenContext

// TODO: Replace this with `RustSymbolProvider.symbolForBuilder`
// TODO(https://github.com/awslabs/smithy-rs/issues/2396): Replace this with `RustSymbolProvider.symbolForBuilder`
fun StructureShape.serverBuilderSymbol(codegenContext: ServerCodegenContext): Symbol =
this.serverBuilderSymbol(
codegenContext.symbolProvider,
!codegenContext.settings.codegenConfig.publicConstrainedTypes,
)

// TODO: Replace this with `RustSymbolProvider.moduleForBuilder`
// TODO(https://github.com/awslabs/smithy-rs/issues/2396): Replace this with `RustSymbolProvider.moduleForBuilder`
fun StructureShape.serverBuilderModule(symbolProvider: SymbolProvider, pubCrate: Boolean): RustModule.LeafModule {
val structureSymbol = symbolProvider.toSymbol(this)
val builderNamespace = RustReservedWords.escapeIfNeeded(structureSymbol.name.toSnakeCase()) +
Expand All @@ -39,7 +39,7 @@ fun StructureShape.serverBuilderModule(symbolProvider: SymbolProvider, pubCrate:
return RustModule.new(builderNamespace, visibility, parent = structureSymbol.module(), inline = true)
}

// TODO: Replace this with `RustSymbolProvider.symbolForBuilder`
// TODO(https://github.com/awslabs/smithy-rs/issues/2396): Replace this with `RustSymbolProvider.symbolForBuilder`
fun StructureShape.serverBuilderSymbol(symbolProvider: SymbolProvider, pubCrate: Boolean): Symbol {
val builderModule = serverBuilderModule(symbolProvider, pubCrate)
val rustType = RustType.Opaque("Builder", builderModule.fullyQualifiedPath())
Expand Down

0 comments on commit 21c8fa4

Please sign in to comment.