Skip to content

Commit 3a8d1d9

Browse files
committed
upgrade function calls to reqwest in issue rust-lang#1059
bumping reqwest 0.9.24 to 0.10.4 requires use of calls that block
1 parent 8918464 commit 3a8d1d9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rocket = "0.4.1"
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_yaml = "0.8.7"
1919
sass-rs = "0.2.1"
20-
reqwest = "0.9"
20+
reqwest = { version = "0.10.4", features = ["blocking", "json"] }
2121
toml = "0.5"
2222
serde_json = "1.0"
2323
rust_team_data = { git = "https://github.com/rust-lang/team" }

src/rust_version.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ enum FetchTarget {
1010
ReleasesFeed,
1111
}
1212

13-
fn fetch(target: FetchTarget) -> Result<reqwest::Response, Box<dyn Error>> {
13+
fn fetch(target: FetchTarget) -> Result<reqwest::blocking::Response, Box<dyn Error>> {
1414
let proxy_env = env::var("http_proxy")
1515
.or_else(|_| env::var("HTTPS_PROXY"))
1616
.ok();
1717

1818
let client = match proxy_env {
1919
Some(proxy_env) => {
2020
let proxy = reqwest::Proxy::https(&proxy_env).unwrap();
21-
reqwest::ClientBuilder::new().proxy(proxy).build().unwrap()
21+
reqwest::blocking::ClientBuilder::new().proxy(proxy).build().unwrap()
2222
}
23-
None => reqwest::Client::new(),
23+
None => reqwest::blocking::Client::new(),
2424
};
2525

2626
let url = match target {

src/teams.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn page_data(section: &str, team_name: &str) -> Result<PageData, Box<dyn Err
116116
}
117117

118118
fn get_teams() -> Result<Box<dyn Any>, Box<dyn Error>> {
119-
let resp: Teams = reqwest::get(&format!("{}/teams.json", BASE_URL))?
119+
let resp: Teams = reqwest::blocking::get(&format!("{}/teams.json", BASE_URL))?
120120
.error_for_status()?
121121
.json()?;
122122

0 commit comments

Comments
 (0)