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

feat(tonic): Use BoxBody from http-body crate #622

Merged
merged 4 commits into from
May 18, 2021
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/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ prost-types = "0.7"
hyper = "0.14"
warp = "0.3"
http = "0.2"
http-body = "0.4"
http-body = "0.4.2"
pin-project = "1.0"
# Health example
tonic-health = { path = "../tonic-health" }
Expand Down
2 changes: 1 addition & 1 deletion interop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ http = "0.2"
futures-core = "0.3"
futures-util = "0.3"
tower = { version = "0.4" }
http-body = "0.4"
http-body = "0.4.2"
hyper = "0.14"
console = "0.14"
structopt = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions tonic-build/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ pub fn generate<T: Service>(

impl<T> #service_ident<T>
where T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::ResponseBody: Body + Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send, {
<T::ResponseBody as Body>::Error: Into<StdError> + Send, {
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
Expand Down
4 changes: 2 additions & 2 deletions tonic-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn generate<T: Service>(
impl<T, B> Service<http::Request<B>> for #server_service<T>
where
T: #server_trait,
B: HttpBody + Send + Sync + 'static,
B: Body + Send + Sync + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
Expand All @@ -91,7 +91,7 @@ pub fn generate<T: Service>(
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(tonic::body::BoxBody::empty())
.body(empty_body())
.unwrap())
}),
}
Expand Down
337 changes: 0 additions & 337 deletions tonic-reflection/tests/proto/grpc.reflection.v1alpha.rs

This file was deleted.

Loading