diff --git a/tonic-build/src/server.rs b/tonic-build/src/server.rs index cf6e23782..105494321 100644 --- a/tonic-build/src/server.rs +++ b/tonic-build/src/server.rs @@ -259,6 +259,7 @@ fn generate_unary<'a, T: Method<'a>>( let (request, response) = method.request_response_name(context); quote! { + #[allow(non_camel_case_types)] struct #service_ident(pub Arc); impl tonic::server::UnaryService<#request> for #service_ident { @@ -310,6 +311,7 @@ fn generate_server_streaming<'a, T: Method<'a>>( let response_stream = quote::format_ident!("{}Stream", method.identifier()); quote! { + #[allow(non_camel_case_types)] struct #service_ident(pub Arc); impl tonic::server::ServerStreamingService<#request> for #service_ident { @@ -360,6 +362,7 @@ fn generate_client_streaming<'a, T: Method<'a>>( let codec_name = syn::parse_str::(context.codec_name()).unwrap(); quote! { + #[allow(non_camel_case_types)] struct #service_ident(pub Arc); impl tonic::server::ClientStreamingService<#request> for #service_ident @@ -413,6 +416,7 @@ fn generate_streaming<'a, T: Method<'a>>( let response_stream = quote::format_ident!("{}Stream", method.identifier()); quote! { + #[allow(non_camel_case_types)] struct #service_ident(pub Arc); impl tonic::server::StreamingService<#request> for #service_ident