From c88b88095c7307f70d9003f9905c76df9313fcd7 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Sun, 18 Oct 2020 09:10:28 +0200 Subject: [PATCH 1/3] drop unused tokio dep Signed-off-by: Marc-Antoine Perennou --- Cargo.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f8f1fd2c..bb21048da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,12 +92,6 @@ futures-channel = { version = "0.3.4", optional = true } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] wasm-bindgen-test = "0.3.10" -[dependencies.tokio] -version = "0.2" -default-features = false -features = ["rt-threaded"] -optional = true - [dev-dependencies] femme = "2.1.1" rand = "0.7.3" From beef46ed4b933f98213d1aee8dbeb7977fdd7e65 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Sun, 18 Oct 2020 09:11:48 +0200 Subject: [PATCH 2/3] update crossbeam-utils Signed-off-by: Marc-Antoine Perennou --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bb21048da..2342aa7f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,7 @@ tokio03 = ["async-global-executor/tokio03"] [dependencies] async-attributes = { version = "1.1.1", optional = true } async-mutex = { version = "1.1.3", optional = true } -crossbeam-utils = { version = "0.7.2", optional = true } +crossbeam-utils = { version = "0.8.0", optional = true } futures-core = { version = "0.3.4", optional = true, default-features = false } futures-io = { version = "0.3.4", optional = true } kv-log-macro = { version = "1.0.6", optional = true } From f0c8a8b4e9a2e7d130a494f4fb5c00d82c2c5c97 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Sun, 18 Oct 2020 09:12:36 +0200 Subject: [PATCH 3/3] update surf Signed-off-by: Marc-Antoine Perennou --- Cargo.toml | 2 +- examples/surf-web.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2342aa7f6..1d431d741 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ pin-utils = { version = "0.1.0-alpha.4", optional = true } slab = { version = "0.4.2", optional = true } # Devdepencency, but they are not allowed to be optional :/ -surf = { version = "1.0.3", optional = true } +surf = { version = "2.0.0", optional = true } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-global-executor = { version = "1.4.0", optional = true, features = ["async-io"] } diff --git a/examples/surf-web.rs b/examples/surf-web.rs index df139e5b5..6ff043d99 100644 --- a/examples/surf-web.rs +++ b/examples/surf-web.rs @@ -1,15 +1,16 @@ use async_std::task; -fn main() -> Result<(), surf::Exception> { +fn main() -> Result<(), surf::Error> { task::block_on(async { let url = "https://www.rust-lang.org"; - let mut response = surf::get(url).await?; + let mut response = surf::get(url).send().await?; let body = response.body_string().await?; dbg!(url); dbg!(response.status()); dbg!(response.version()); - dbg!(response.headers()); + dbg!(response.header_names()); + dbg!(response.header_values()); dbg!(body.len()); Ok(())