Skip to content

Commit 2b7ffb2

Browse files
committed
fix infinite recursion
1 parent 4136e7b commit 2b7ffb2

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

scopegraphs-lib/src/containers/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ where
9595
let fut = Shared::clone(&self.0);
9696
FutureWrapper::new(async move {
9797
let env = fut.await;
98-
map(&env).await
98+
map(&env).0.await
9999
})
100100
}
101101
}

scopegraphs-lib/src/containers/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ where
6868
) -> Self::EnvContainer {
6969
let future = async move {
7070
let paths = self.0.await;
71-
let env_futures = paths.into_iter().map(f);
71+
let env_futures = paths.into_iter().map(f).map(|i| i.0);
7272
let envs = join_all(env_futures).await;
7373
envs.into_iter().collect::<Env<_, _>>()
7474
};

scopegraphs-lib/src/containers/scope.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ where
4242
type PathContainer = FutureWrapper<'rslv, SC::PathContainer>;
4343

4444
fn lift_step(self, lbl: LABEL, prefix: Path<LABEL>) -> Self::PathContainer {
45-
FutureWrapper::new(async move { self.await.lift_step(lbl, prefix.clone()) })
45+
FutureWrapper::new(async move { self.0.await.lift_step(lbl, prefix.clone()) })
4646
}
4747
}

scopegraphs-lib/src/future_wrapper.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ impl<T> Debug for FutureWrapper<'_, T> {
3030
}
3131
}
3232

33-
impl<'fut, T> Future for FutureWrapper<'fut, T> {
33+
impl<'fut, T: Clone> Future for FutureWrapper<'fut, T> {
3434
type Output = T;
3535

3636
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
37-
let p: Pin<&mut dyn Future<Output = T>> = self.as_mut();
38-
p.poll(cx)
37+
Pin::new(&mut self.0).poll(cx)
3938
}
4039
}

0 commit comments

Comments
 (0)