Skip to content

Commit 0d6b25a

Browse files
authored
Relax Send constraint in lambda-http (#442)
1 parent 8858f6b commit 0d6b25a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lambda-http/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub type Request = http::Request<Body>;
9191
#[doc(hidden)]
9292
pub struct TransformResponse<'a, R, E> {
9393
request_origin: RequestOrigin,
94-
fut: Pin<Box<dyn Future<Output = Result<R, E>> + Send + 'a>>,
94+
fut: Pin<Box<dyn Future<Output = Result<R, E>> + 'a>>,
9595
}
9696

9797
impl<'a, R, E> Future for TransformResponse<'a, R, E>
@@ -121,8 +121,8 @@ pub struct Adapter<'a, R, S> {
121121

122122
impl<'a, R, S> From<S> for Adapter<'a, R, S>
123123
where
124-
S: Service<Request, Response = R, Error = Error> + Send,
125-
S::Future: Send + 'a,
124+
S: Service<Request, Response = R, Error = Error>,
125+
S::Future: 'a,
126126
R: IntoResponse,
127127
{
128128
fn from(service: S) -> Self {
@@ -135,8 +135,8 @@ where
135135

136136
impl<'a, R, S> Service<LambdaEvent<LambdaRequest>> for Adapter<'a, R, S>
137137
where
138-
S: Service<Request, Response = R, Error = Error> + Send,
139-
S::Future: Send + 'a,
138+
S: Service<Request, Response = R, Error = Error>,
139+
S::Future: 'a,
140140
R: IntoResponse,
141141
{
142142
type Response = LambdaResponse;
@@ -162,8 +162,8 @@ where
162162
/// converting the result into a [`LambdaResponse`].
163163
pub async fn run<'a, R, S>(handler: S) -> Result<(), Error>
164164
where
165-
S: Service<Request, Response = R, Error = Error> + Send,
166-
S::Future: Send + 'a,
165+
S: Service<Request, Response = R, Error = Error>,
166+
S::Future: 'a,
167167
R: IntoResponse,
168168
{
169169
lambda_runtime::run(Adapter::from(handler)).await

0 commit comments

Comments
 (0)