From 11196c853dc42e86d608c4ed29af1a8f0c5c5084 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Tue, 20 Oct 2020 14:45:37 +0200 Subject: [PATCH] chore: update dependencies --- Cargo.toml | 10 ++-------- examples/surf-web.rs | 7 ++++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f8f1fd2c..1d431d741 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 } @@ -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"] } @@ -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" 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(())