Unverified Commit 251102a7 authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Rename `serverOperationHandler` to `OperationHandler` in `ServerRuntimeType.kt` (#1291)

All other members start with an uppercase letter, and the "server"
prefix is not necessary since they are namespaced under a
server-specific file.
parent 7245df1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ object ServerRuntimeType {
    fun RequestSpecModule(runtimeConfig: RuntimeConfig) =
        RuntimeType("request_spec", ServerCargoDependency.SmithyHttpServer(runtimeConfig), "${runtimeConfig.crateSrcPrefix}_http_server::routing")

    fun serverOperationHandler(runtimeConfig: RuntimeConfig) =
    fun OperationHandler(runtimeConfig: RuntimeConfig) =
        forInlineDependency(ServerInlineDependency.serverOperationHandler(runtimeConfig))

    fun RuntimeError(runtimeConfig: RuntimeConfig) =
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ class ServerOperationHandlerGenerator(
        "SmithyHttp" to CargoDependency.SmithyHttp(runtimeConfig).asType(),
        "SmithyHttpServer" to ServerCargoDependency.SmithyHttpServer(runtimeConfig).asType(),
        "Phantom" to ServerRuntimeType.Phantom,
        "ServerOperationHandler" to ServerRuntimeType.serverOperationHandler(runtimeConfig),
        "ServerOperationHandler" to ServerRuntimeType.OperationHandler(runtimeConfig),
        "http" to RuntimeType.http,
    )

+1 −3
Original line number Diff line number Diff line
@@ -7,10 +7,8 @@ package software.amazon.smithy.rust.codegen.server.smithy.generators

import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.rust.codegen.rustlang.Attribute
import software.amazon.smithy.rust.codegen.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.rustlang.RustWriter
import software.amazon.smithy.rust.codegen.rustlang.asType
import software.amazon.smithy.rust.codegen.rustlang.rust
import software.amazon.smithy.rust.codegen.rustlang.rustBlock
import software.amazon.smithy.rust.codegen.rustlang.rustBlockTemplate
import software.amazon.smithy.rust.codegen.rustlang.rustTemplate
@@ -36,7 +34,7 @@ class ServerOperationRegistryGenerator(
    private val codegenScope = arrayOf(
        "Router" to ServerRuntimeType.Router(runtimeConfig),
        "SmithyHttpServer" to ServerCargoDependency.SmithyHttpServer(runtimeConfig).asType(),
        "ServerOperationHandler" to ServerRuntimeType.serverOperationHandler(runtimeConfig),
        "ServerOperationHandler" to ServerRuntimeType.OperationHandler(runtimeConfig),
        "Tower" to ServerCargoDependency.Tower.asType(),
        "Phantom" to ServerRuntimeType.Phantom,
        "StdError" to RuntimeType.StdError