Created
May 30, 2018 12:25
-
-
Save drorlevywork/db09a9a9806b2623eca538725483eb3d to your computer and use it in GitHub Desktop.
theissue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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