From 9f5fc3b9679c610fbe8de6aefc2f56855dbcbf66 Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 8 Jul 2024 16:32:34 +0900 Subject: [PATCH] chore: Replace unit struct with ordinary struct (#1777) --- examples/src/authentication/server.rs | 2 +- examples/src/multiplex/server.rs | 2 +- examples/src/tls/server.rs | 2 +- examples/src/tls_client_auth/server.rs | 2 +- examples/src/tls_rustls/server.rs | 2 +- examples/src/tower/server.rs | 2 +- interop/src/server.rs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/src/authentication/server.rs b/examples/src/authentication/server.rs index d0a59cbc1..aed197413 100644 --- a/examples/src/authentication/server.rs +++ b/examples/src/authentication/server.rs @@ -8,7 +8,7 @@ use tonic::{metadata::MetadataValue, transport::Server, Request, Response, Statu type EchoResult = Result, Status>; #[derive(Default)] -pub struct EchoServer; +pub struct EchoServer {} #[tonic::async_trait] impl pb::echo_server::Echo for EchoServer { diff --git a/examples/src/multiplex/server.rs b/examples/src/multiplex/server.rs index 9b148c861..68f05e157 100644 --- a/examples/src/multiplex/server.rs +++ b/examples/src/multiplex/server.rs @@ -51,7 +51,7 @@ impl Greeter for MyGreeter { } #[derive(Default)] -pub struct MyEcho; +pub struct MyEcho {} #[tonic::async_trait] impl Echo for MyEcho { diff --git a/examples/src/tls/server.rs b/examples/src/tls/server.rs index 08697b221..5d2935fd8 100644 --- a/examples/src/tls/server.rs +++ b/examples/src/tls/server.rs @@ -14,7 +14,7 @@ use tonic::{ type EchoResult = Result, Status>; #[derive(Default)] -pub struct EchoServer; +pub struct EchoServer {} #[tonic::async_trait] impl pb::echo_server::Echo for EchoServer { diff --git a/examples/src/tls_client_auth/server.rs b/examples/src/tls_client_auth/server.rs index 840c70ac9..224620523 100644 --- a/examples/src/tls_client_auth/server.rs +++ b/examples/src/tls_client_auth/server.rs @@ -9,7 +9,7 @@ use tonic::{Request, Response, Status}; type EchoResult = Result, Status>; #[derive(Default)] -pub struct EchoServer; +pub struct EchoServer {} #[tonic::async_trait] impl pb::echo_server::Echo for EchoServer { diff --git a/examples/src/tls_rustls/server.rs b/examples/src/tls_rustls/server.rs index 23f894966..6f011689a 100644 --- a/examples/src/tls_rustls/server.rs +++ b/examples/src/tls_rustls/server.rs @@ -91,7 +91,7 @@ struct ConnInfo { type EchoResult = Result, Status>; #[derive(Default)] -pub struct EchoServer; +pub struct EchoServer {} #[tonic::async_trait] impl pb::echo_server::Echo for EchoServer { diff --git a/examples/src/tower/server.rs b/examples/src/tower/server.rs index b7066a1b6..a4f9f4237 100644 --- a/examples/src/tower/server.rs +++ b/examples/src/tower/server.rs @@ -66,7 +66,7 @@ fn intercept(req: Request<()>) -> Result, Status> { } #[derive(Debug, Clone, Default)] -struct MyMiddlewareLayer; +struct MyMiddlewareLayer {} impl Layer for MyMiddlewareLayer { type Service = MyMiddleware; diff --git a/interop/src/server.rs b/interop/src/server.rs index 38b1be65e..96fc1cbba 100644 --- a/interop/src/server.rs +++ b/interop/src/server.rs @@ -14,7 +14,7 @@ pub use pb::test_service_server::TestServiceServer; pub use pb::unimplemented_service_server::UnimplementedServiceServer; #[derive(Default, Clone)] -pub struct TestService; +pub struct TestService {} type Result = std::result::Result, Status>; type Streaming = Request>; @@ -156,7 +156,7 @@ impl pb::test_service_server::TestService for TestService { } #[derive(Default)] -pub struct UnimplementedService; +pub struct UnimplementedService {} #[tonic::async_trait] impl pb::unimplemented_service_server::UnimplementedService for UnimplementedService {