Skip to content

Commit 0b7f4c4

Browse files
author
Rasmus Viitanen
committed
remove send and sync bounds for handler
1 parent 8d7d2a3 commit 0b7f4c4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lambda-runtime/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub struct HandlerFn<F> {
9393
impl<F, A, B, Error, Fut> Handler<A, B> for HandlerFn<F>
9494
where
9595
F: Fn(A, Context) -> Fut,
96-
Fut: Future<Output = Result<B, Error>> + Send,
96+
Fut: Future<Output = Result<B, Error>>,
9797
Error: Into<Box<dyn std::error::Error + Send + Sync + 'static>> + fmt::Display,
9898
{
9999
type Error = Error;
@@ -135,11 +135,11 @@ where
135135
handler: F,
136136
) -> Result<(), Error>
137137
where
138-
F: Handler<A, B> + Send + Sync + RefUnwindSafe,
139-
<F as Handler<A, B>>::Fut: Future<Output = Result<B, <F as Handler<A, B>>::Error>> + Send,
140-
<F as Handler<A, B>>::Error: fmt::Display + Send + Sync,
141-
A: for<'de> Deserialize<'de> + Send + Sync + UnwindSafe,
142-
B: Serialize + Send + Sync + UnwindSafe,
138+
F: Handler<A, B> + RefUnwindSafe,
139+
<F as Handler<A, B>>::Fut: Future<Output = Result<B, <F as Handler<A, B>>::Error>>,
140+
<F as Handler<A, B>>::Error: fmt::Display,
141+
A: for<'de> Deserialize<'de> + UnwindSafe,
142+
B: Serialize + UnwindSafe,
143143
{
144144
let client = &self.client;
145145
tokio::pin!(incoming);
@@ -291,11 +291,11 @@ where
291291
/// ```
292292
pub async fn run<A, B, F>(handler: F) -> Result<(), Error>
293293
where
294-
F: Handler<A, B> + Send + Sync + RefUnwindSafe,
295-
<F as Handler<A, B>>::Fut: Future<Output = Result<B, <F as Handler<A, B>>::Error>> + Send,
296-
<F as Handler<A, B>>::Error: fmt::Display + Send + Sync,
297-
A: for<'de> Deserialize<'de> + Send + Sync + UnwindSafe,
298-
B: Serialize + Send + Sync + UnwindSafe,
294+
F: Handler<A, B> + RefUnwindSafe,
295+
<F as Handler<A, B>>::Fut: Future<Output = Result<B, <F as Handler<A, B>>::Error>>,
296+
<F as Handler<A, B>>::Error: fmt::Display,
297+
A: for<'de> Deserialize<'de> + UnwindSafe,
298+
B: Serialize + UnwindSafe,
299299
{
300300
trace!("Loading config from env");
301301
let config = Config::from_env()?;

0 commit comments

Comments
 (0)