Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drorlevywork/db09a9a9806b2623eca538725483eb3d to your computer and use it in GitHub Desktop.
Save drorlevywork/db09a9a9806b2623eca538725483eb3d to your computer and use it in GitHub Desktop.
theissue
fn sometest(c: future::Loop<u32,u32>) -> impl Future<Item=future::Loop<u32,u32>,Error=u32>
{
let delay = if let future::Loop::Continue(_) = c {
Instant::now().add(Duration::from_secs(1))
} else {
Instant::now()
};
let res = Delay::new(delay)
.map(move |_|{
c
})
.map_err(|_|
{
1
});
//this causes an error//
if let future::Loop::Continue(_) = c{
res.map_err(|e|{
e
})
}
else
{
res
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment