Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace unit struct with ordinary struct #1777

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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