mirror of https://github.com/smithy-lang/smithy-rs
Remove unnecessary call to upgrade to a server protocol for `ServerServiceGeneratorV2` (#1805)
The protocol `ServerServiceGenerator` hosts is already typed as a `ServerProtocol`.
This commit is contained in:
parent
7fb7e177d0
commit
39c0096c33
|
@ -89,10 +89,9 @@ open class ServerServiceGenerator(
|
|||
rustCrate.withModule(
|
||||
RustModule("service", RustMetadata(visibility = Visibility.PUBLIC, additionalAttributes = listOf(Attribute.DocHidden)), null),
|
||||
) { writer ->
|
||||
val serverProtocol = ServerProtocol.fromCoreProtocol(protocol)
|
||||
ServerServiceGeneratorV2(
|
||||
codegenContext,
|
||||
serverProtocol,
|
||||
protocol,
|
||||
).render(writer)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ package software.amazon.smithy.rust.codegen.server.smithy.protocols
|
|||
import software.amazon.smithy.rust.codegen.core.smithy.generators.protocol.ProtocolSupport
|
||||
import software.amazon.smithy.rust.codegen.core.smithy.protocols.Protocol
|
||||
import software.amazon.smithy.rust.codegen.core.smithy.protocols.ProtocolGeneratorFactory
|
||||
import software.amazon.smithy.rust.codegen.core.smithy.protocols.RestJson
|
||||
import software.amazon.smithy.rust.codegen.server.smithy.ServerCodegenContext
|
||||
import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.ServerRestJsonProtocol
|
||||
|
||||
|
@ -17,7 +16,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.Ser
|
|||
* with RestJson1 specific configurations.
|
||||
*/
|
||||
class ServerRestJsonFactory : ProtocolGeneratorFactory<ServerHttpBoundProtocolGenerator, ServerCodegenContext> {
|
||||
override fun protocol(codegenContext: ServerCodegenContext): Protocol = RestJson(codegenContext)
|
||||
override fun protocol(codegenContext: ServerCodegenContext): Protocol = ServerRestJsonProtocol(codegenContext)
|
||||
|
||||
override fun buildProtocolGenerator(codegenContext: ServerCodegenContext): ServerHttpBoundProtocolGenerator =
|
||||
ServerHttpBoundProtocolGenerator(codegenContext, ServerRestJsonProtocol(codegenContext))
|
||||
|
|
Loading…
Reference in New Issue