refactor: nicer code

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
pull/24376/head
Marco Neumann 2021-12-16 08:19:33 +00:00
parent ed775431b6
commit f4fde15810
1 changed files with 9 additions and 10 deletions

View File

@ -97,17 +97,16 @@ impl ServerType for TestServerType {
}
async fn server_grpc(self: Arc<Self>, builder_input: RpcBuilderInput) -> Result<(), RpcError> {
if self.test_action == TestAction::PanicInGrpcWorker {
panic!("Test panic in gRPC worker");
}
if self.test_action == TestAction::EarlyReturnFromGrpcWorker {
return Ok(());
}
match self.test_action {
TestAction::PanicInGrpcWorker => panic!("Test panic in gRPC worker"),
TestAction::EarlyReturnFromGrpcWorker => Ok(()),
_ => {
let builder = setup_builder!(builder_input, self);
serve_builder!(builder);
let builder = setup_builder!(builder_input, self);
serve_builder!(builder);
Ok(())
Ok(())
}
}
}
async fn join(self: Arc<Self>) {