Skip to content

Commit

Permalink
chore: Replace unit struct with ordinary struct (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jul 8, 2024
1 parent 1c327a2 commit 9f5fc3b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/src/authentication/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tonic::{metadata::MetadataValue, transport::Server, Request, Response, Statu
type EchoResult<T> = Result<Response<T>, Status>;

#[derive(Default)]
pub struct EchoServer;
pub struct EchoServer {}

#[tonic::async_trait]
impl pb::echo_server::Echo for EchoServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/multiplex/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Greeter for MyGreeter {
}

#[derive(Default)]
pub struct MyEcho;
pub struct MyEcho {}

#[tonic::async_trait]
impl Echo for MyEcho {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/tls/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tonic::{
type EchoResult<T> = Result<Response<T>, Status>;

#[derive(Default)]
pub struct EchoServer;
pub struct EchoServer {}

#[tonic::async_trait]
impl pb::echo_server::Echo for EchoServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/tls_client_auth/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tonic::{Request, Response, Status};
type EchoResult<T> = Result<Response<T>, Status>;

#[derive(Default)]
pub struct EchoServer;
pub struct EchoServer {}

#[tonic::async_trait]
impl pb::echo_server::Echo for EchoServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/tls_rustls/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct ConnInfo {
type EchoResult<T> = Result<Response<T>, Status>;

#[derive(Default)]
pub struct EchoServer;
pub struct EchoServer {}

#[tonic::async_trait]
impl pb::echo_server::Echo for EchoServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/tower/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn intercept(req: Request<()>) -> Result<Request<()>, Status> {
}

#[derive(Debug, Clone, Default)]
struct MyMiddlewareLayer;
struct MyMiddlewareLayer {}

impl<S> Layer<S> for MyMiddlewareLayer {
type Service = MyMiddleware<S>;
Expand Down
4 changes: 2 additions & 2 deletions interop/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = std::result::Result<Response<T>, Status>;
type Streaming<T> = Request<tonic::Streaming<T>>;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9f5fc3b

Please sign in to comment.