Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0c8a8b

Browse files
committed
update surf
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
1 parentbeef46e commitf0c8a8b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎Cargo.toml

Lines changed: 1 addition & 1 deletion
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

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

3-
fnmain() ->Result<(), surf::Exception>{
3+
fnmain() ->Result<(), surf::Error>{
44
task::block_on(async{
55
let url ="https://www.rust-lang.org";
6-
letmut response = surf::get(url).await?;
6+
letmut 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)

[8]ページ先頭

©2009-2025 Movatter.jp