Skip to content

Commit 391d841

Browse files
No need for the run future to be Sync (#32)
1 parent 4c828ed commit 391d841

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/context/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ pub trait ContextSideEffects<'ctx>: private::SealedContext<'ctx> {
375375
#[must_use]
376376
fn run<R, F, T>(&self, run_closure: R) -> impl RunFuture<Result<T, TerminalError>> + 'ctx
377377
where
378-
R: RunClosure<Fut = F, Output = T> + Send + Sync + 'ctx,
379-
F: Future<Output = HandlerResult<T>> + Send + Sync + 'ctx,
378+
R: RunClosure<Fut = F, Output = T> + Send + 'ctx,
379+
F: Future<Output = HandlerResult<T>> + Send + 'ctx,
380380
T: Serialize + Deserialize + 'static,
381381
{
382382
self.inner_context().run(run_closure)

src/endpoint/context.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,10 @@ impl ContextInternal {
530530
pub fn run<'a, Run, Fut, Out>(
531531
&'a self,
532532
run_closure: Run,
533-
) -> impl crate::context::RunFuture<Result<Out, TerminalError>> + Send + Sync + 'a
533+
) -> impl crate::context::RunFuture<Result<Out, TerminalError>> + Send + 'a
534534
where
535-
Run: RunClosure<Fut = Fut, Output = Out> + Send + Sync + 'a,
536-
Fut: Future<Output = HandlerResult<Out>> + Send + Sync + 'a,
535+
Run: RunClosure<Fut = Fut, Output = Out> + Send + 'a,
536+
Fut: Future<Output = HandlerResult<Out>> + Send + 'a,
537537
Out: Serialize + Deserialize + 'static,
538538
{
539539
let this = Arc::clone(&self.inner);
@@ -634,8 +634,8 @@ impl<Run, Fut, Ret> RunFuture<Run, Fut, Ret> {
634634
impl<Run, Fut, Out> crate::context::RunFuture<Result<Result<Out, TerminalError>, Error>>
635635
for RunFuture<Run, Fut, Out>
636636
where
637-
Run: RunClosure<Fut = Fut, Output = Out> + Send + Sync,
638-
Fut: Future<Output = HandlerResult<Out>> + Send + Sync,
637+
Run: RunClosure<Fut = Fut, Output = Out> + Send,
638+
Fut: Future<Output = HandlerResult<Out>> + Send,
639639
Out: Serialize + Deserialize,
640640
{
641641
fn retry_policy(mut self, retry_policy: RunRetryPolicy) -> Self {
@@ -657,9 +657,9 @@ where
657657

658658
impl<Run, Fut, Out> Future for RunFuture<Run, Fut, Out>
659659
where
660-
Run: RunClosure<Fut = Fut, Output = Out> + Send + Sync,
660+
Run: RunClosure<Fut = Fut, Output = Out> + Send,
661661
Out: Serialize + Deserialize,
662-
Fut: Future<Output = HandlerResult<Out>> + Send + Sync,
662+
Fut: Future<Output = HandlerResult<Out>> + Send,
663663
{
664664
type Output = Result<Result<Out, TerminalError>, Error>;
665665

0 commit comments

Comments
 (0)