From 74e440021922f0550a9b6fc36ee4f352e4bb45f1 Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 15 Feb 2023 23:46:27 +0900 Subject: [PATCH] chore: Use feature resolver v2 and turn off unused features (#1270) * chore: Use feature resolver version 2 * chore(web): Turn off unused features --- Cargo.toml | 1 + tonic-web/Cargo.toml | 4 ++-- tonic-web/src/service.rs | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1cedaee..9e2f8d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,3 +24,4 @@ members = [ "tonic-web/tests/integration", "tests/service_named_result", ] +resolver = "2" diff --git a/tonic-web/Cargo.toml b/tonic-web/Cargo.toml index 82bbb97..33ea562 100644 --- a/tonic-web/Cargo.toml +++ b/tonic-web/Cargo.toml @@ -20,9 +20,9 @@ bytes = "1.0" futures-core = "0.3" http = "0.2" http-body = "0.4" -hyper = "0.14" +hyper = {version = "0.14", default-features = false, features = ["stream"]} pin-project = "1" -tonic = {version = "0.8", path = "../tonic", default-features = false, features = ["transport"]} +tonic = {version = "0.8", path = "../tonic", default-features = false} tower-service = "0.3" tower-layer = "0.3" tower-http = { version = "0.3", features = ["cors"] } diff --git a/tonic-web/src/service.rs b/tonic-web/src/service.rs index b071ec4..ee3428e 100644 --- a/tonic-web/src/service.rs +++ b/tonic-web/src/service.rs @@ -6,8 +6,10 @@ use std::task::{Context, Poll}; use http::{header, HeaderMap, HeaderValue, Method, Request, Response, StatusCode, Version}; use hyper::Body; use pin_project::pin_project; -use tonic::body::{empty_body, BoxBody}; -use tonic::transport::NamedService; +use tonic::{ + body::{empty_body, BoxBody}, + server::NamedService, +}; use tower_service::Service; use tracing::{debug, trace};