From 97ae25daa14c8656d63c073d0709e8828c657bfa Mon Sep 17 00:00:00 2001 From: tottoto Date: Mon, 30 Sep 2024 20:41:48 +0900 Subject: [PATCH] chore(web): Remove Clone Send and static lifetime bound from service (#1963) --- tonic-web/src/layer.rs | 2 -- tonic-web/src/lib.rs | 4 ---- 2 files changed, 6 deletions(-) diff --git a/tonic-web/src/layer.rs b/tonic-web/src/layer.rs index eb4c71451..3383554e1 100644 --- a/tonic-web/src/layer.rs +++ b/tonic-web/src/layer.rs @@ -19,8 +19,6 @@ impl GrpcWebLayer { impl Layer for GrpcWebLayer where S: Service, Response = http::Response>, - S: Send + 'static, - S::Future: Send + 'static, { type Service = GrpcWebService; diff --git a/tonic-web/src/lib.rs b/tonic-web/src/lib.rs index 453cdedda..d768a7005 100644 --- a/tonic-web/src/lib.rs +++ b/tonic-web/src/lib.rs @@ -133,8 +133,6 @@ const DEFAULT_ALLOW_HEADERS: [HeaderName; 4] = [ pub fn enable(service: S) -> CorsGrpcWeb where S: Service, Response = http::Response>, - S: Clone + Send + 'static, - S::Future: Send + 'static, { let cors = CorsLayer::new() .allow_origin(AllowOrigin::mirror_request()) @@ -154,8 +152,6 @@ pub struct CorsGrpcWeb(tower_http::cors::Cors>); impl Service> for CorsGrpcWeb where S: Service, Response = http::Response>, - S: Clone + Send + 'static, - S::Future: Send + 'static, { type Response = S::Response; type Error = S::Error;