Skip to content

Commit f0c8a8b

Browse files
committed
update surf
Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent beef46e commit f0c8a8b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pin-utils = { version = "0.1.0-alpha.4", optional = true }
7676
slab = { version = "0.4.2", optional = true }
7777

7878
# Devdepencency, but they are not allowed to be optional :/
79-
surf = { version = "1.0.3", optional = true }
79+
surf = { version = "2.0.0", optional = true }
8080

8181
[target.'cfg(not(target_os = "unknown"))'.dependencies]
8282
async-global-executor = { version = "1.4.0", optional = true, features = ["async-io"] }

examples/surf-web.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
use async_std::task;
22

3-
fn main() -> Result<(), surf::Exception> {
3+
fn main() -> Result<(), surf::Error> {
44
task::block_on(async {
55
let url = "https://www.rust-lang.org";
6-
let mut response = surf::get(url).await?;
6+
let mut response = surf::get(url).send().await?;
77
let body = response.body_string().await?;
88

99
dbg!(url);
1010
dbg!(response.status());
1111
dbg!(response.version());
12-
dbg!(response.headers());
12+
dbg!(response.header_names());
13+
dbg!(response.header_values());
1314
dbg!(body.len());
1415

1516
Ok(())

0 commit comments

Comments
 (0)