remove reqwest (#139)

This commit is contained in:
Tensor-Programming
2019-12-12 15:21:02 -05:00
committed by GitHub
parent 6f42cc1ded
commit f524d72ca5
4 changed files with 37 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ walkdir = "2"
sha2 = "0.8"
lazy_static = "1.4"
handlebars = "2.0"
reqwest = "0.9.22"
attohttpc = "0.7.0"
hex = "0.4"
zip = "0.5"

View File

@@ -53,13 +53,9 @@ lazy_static! {
fn download_and_verify(url: &str, hash: &str) -> crate::Result<Vec<u8>> {
common::print_info(format!("Downloading {}", url).as_str())?;
let mut response = reqwest::get(url).or_else(|e| Err(e.to_string()))?;
let response = attohttpc::get(url).send().or_else(|e| Err(e.to_string()))?;
let mut data: Vec<u8> = Vec::new();
response
.read_to_end(&mut data)
.or_else(|e| Err(e.to_string()))?;
let data: Vec<u8> = response.bytes().or_else(|e| Err(e.to_string()))?;
common::print_info("validating hash")?;

View File

@@ -27,7 +27,9 @@ error_chain! {
Term(::term::Error);
Toml(::toml::de::Error);
Walkdir(::walkdir::Error);
HttpError(::attohttpc::Error);
StripError(std::path::StripPrefixError);
}
errors {}
}