aboutsummaryrefslogtreecommitdiff
path: root/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'main.rs')
-rw-r--r--main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.rs b/main.rs
index c55eba2..828cc22 100644
--- a/main.rs
+++ b/main.rs
@@ -121,6 +121,7 @@ fn main() {
};
println!("requesting...");
+ /*
let work = client.request(req).and_then(|res| {
res.body().for_each(move |body: hyper::Chunk| {
println!("hmmm");
@@ -128,6 +129,13 @@ fn main() {
Ok(())
})
});
+ */
+
+ let work = client.request(req).and_then(|res| {
+ res.body()
+ .map(|chunk| futures::stream::iter(chunk.into_iter().map(|b| -> Result<u8, hyper::Error> { Ok(b) })))
+ .flatten().for_each(|byte| Ok(print!("{}", byte as char)))
+ });
println!("Before?");
let resp = core.run(work).unwrap();