summaryrefslogtreecommitdiff
path: root/src/upnp.rs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-07-17 22:59:24 +0300
committerYuval Adam <_@yuv.al>2018-07-17 22:59:24 +0300
commitc3ea11e82d856817d123ea4a9a9d3576b17817a7 (patch)
tree6554caa4d5ba3ad1729bad37420e136139714d42 /src/upnp.rs
parentf0508f43937f1ec8b46d1428602c333f615aa607 (diff)
First round of runtime refactoring
Diffstat (limited to 'src/upnp.rs')
-rw-r--r--src/upnp.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/upnp.rs b/src/upnp.rs
index 7a228b6..8eeac00 100644
--- a/src/upnp.rs
+++ b/src/upnp.rs
@@ -49,26 +49,18 @@ fn fetch_url(url: hyper::Uri) -> impl Future<Item=(), Error=()> {
let client = Client::new();
client
- // Fetch the url...
.get(url)
- // And then, if we get a response back...
.and_then(|res| {
println!("Response: {}", res.status());
println!("Headers: {:#?}", res.headers());
-
- // The body is a stream, and for_each returns a new Future
- // when the stream is finished, and calls the closure on
- // each chunk of the body...
res.into_body().for_each(|chunk| {
io::stdout().write_all(&chunk)
.map_err(|e| panic!("example expects stdout is open, error={}", e))
})
})
- // If all good, just tell the user...
.map(|_| {
println!("\n\nDone.");
})
- // If there was an error, let the user know...
.map_err(|err| {
eprintln!("Error {}", err);
})