summaryrefslogtreecommitdiff
path: root/cli/http_util.rs
diff options
context:
space:
mode:
authorGurwinder Singh <vargwin@gmail.com>2020-01-01 20:21:27 +0530
committerRy Dahl <ry@tinyclouds.org>2020-01-01 09:51:27 -0500
commit55add2d366c5b3e19bd91958f3e3a36b4439839d (patch)
tree35c68bbc6140ea99c9deebe12c0fb1abc85ae2e8 /cli/http_util.rs
parent4258ed262f6eed9b0ee123e1ba9c91f999f0b429 (diff)
cleanup after tokio upgrade (#3571)
tokio_util::run and tokio::run_on_current_thread should accept Future<Output=()> instead of Future<Output=Result<(), ()>>. Currently, all the passed futures have to add Ok(()) or futures::future::ok(()) unnecessarily to call this method.
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r--cli/http_util.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs
index 4a925e3d9..a1c2fa3ac 100644
--- a/cli/http_util.rs
+++ b/cli/http_util.rs
@@ -215,11 +215,10 @@ mod tests {
let url =
Url::parse("http://127.0.0.1:4545/cli/tests/fixture.json").unwrap();
- let fut = fetch_string_once(&url).then(|result| match result {
+ let fut = fetch_string_once(&url).map(|result| match result {
Ok(FetchOnceResult::Code(code, maybe_content_type)) => {
assert!(!code.is_empty());
assert_eq!(maybe_content_type, Some("application/json".to_string()));
- futures::future::ok(())
}
_ => panic!(),
});
@@ -237,10 +236,9 @@ mod tests {
// Dns resolver substitutes `127.0.0.1` with `localhost`
let target_url =
Url::parse("http://localhost:4545/cli/tests/fixture.json").unwrap();
- let fut = fetch_string_once(&url).then(move |result| match result {
+ let fut = fetch_string_once(&url).map(move |result| match result {
Ok(FetchOnceResult::Redirect(url)) => {
assert_eq!(url, target_url);
- futures::future::ok(())
}
_ => panic!(),
});