Bump reqwest form 0.9 to 0.11

This commit is contained in:
Ronak Buch
2021-05-27 15:51:19 -04:00
committed by Henrik Friedrichsen
parent 0d405cf221
commit 1259badd9a
4 changed files with 136 additions and 535 deletions

View File

@@ -51,7 +51,7 @@ pub fn create_credentials() -> Result<RespotCredentials, String> {
})
.button("Login with Facebook", |s| {
let urls: std::collections::HashMap<String, String> =
reqwest::get("https://login2.spotify.com/v1/config")
reqwest::blocking::get("https://login2.spotify.com/v1/config")
.expect("didn't connect")
.json()
.expect("didn't parse");
@@ -92,7 +92,7 @@ fn auth_poller(url: &str, app_sink: &CbSink) {
.unwrap_or(timeout)
< timeout
{
if let Ok(mut response) = reqwest::get(&url) {
if let Ok(mut response) = reqwest::blocking::get(&url) {
if response.status() != reqwest::StatusCode::ACCEPTED {
let result = match response.status() {
reqwest::StatusCode::OK => {

View File

@@ -292,8 +292,8 @@ impl ViewExt for CoverView {
}
fn download(url: String, path: PathBuf) -> Result<(), std::io::Error> {
let mut resp =
reqwest::get(&url).map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
let mut resp = reqwest::blocking::get(&url)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
std::fs::create_dir_all(path.parent().unwrap())?;
let mut file = File::create(path)?;