chore(build): upgrade ureq to 2.0

This commit is contained in:
LongYinan 2021-01-04 11:01:13 +08:00
parent 63b643914b
commit 294563d8dc
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881
3 changed files with 13 additions and 12 deletions
build/src

View file

@ -23,16 +23,17 @@ fn download_node_lib(dist_url: &str, version: &str, arch: &str) -> Vec<u8> {
arch = arch
);
let response = ureq::get(&url).call();
if let Some(error) = response.synthetic_error() {
panic!("Failed to download node.lib: {:#?}", error);
match ureq::get(&url).call() {
Ok(response) => {
let mut reader = response.into_reader();
let mut bytes = vec![];
reader.read_to_end(&mut bytes).unwrap();
bytes
}
Err(error) => {
panic!("Failed to download node.lib: {:#?}", error);
}
}
let mut reader = response.into_reader();
let mut bytes = vec![];
reader.read_to_end(&mut bytes).unwrap();
bytes
}
pub fn setup() {