mirror of
https://github.com/msfjarvis/adx.git
synced 2024-06-02 20:08:10 +05:30
Switch from reqwest to ureq
Reduces our dependency tree from 188 crates to 50 and does not regress performance since we only used the blocking aspects of reqwest anyway Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
d3334a134a
commit
004e11565f
1383
Cargo.lock
generated
1383
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -14,10 +14,10 @@ publish = false
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
reqwest = "0.9.22"
|
||||
clap = "2.33.0"
|
||||
log = "0.4.8"
|
||||
roxmltree = "0.7.3"
|
||||
ureq = "0.11.2"
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "actively-developed" }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extern crate clap;
|
||||
extern crate log;
|
||||
extern crate reqwest;
|
||||
extern crate roxmltree;
|
||||
extern crate ureq;
|
||||
|
||||
use clap::{App, Arg};
|
||||
use log::{LevelFilter, Metadata, Record};
|
||||
|
|
|
@ -46,9 +46,9 @@ fn get_maven_index() -> Result<String, std::io::Error> {
|
|||
/// Downloads the Maven master index for Google's Maven Repository
|
||||
/// and returns the XML as a String
|
||||
#[cfg(not(test))]
|
||||
fn get_maven_index() -> Result<String, reqwest::Error> {
|
||||
fn get_maven_index() -> Result<String, std::io::Error> {
|
||||
info!("Downloading maven index...");
|
||||
reqwest::get("https://dl.google.com/dl/android/maven2/master-index.xml")?.text()
|
||||
ureq::get("https://dl.google.com/dl/android/maven2/master-index.xml").call().into_string()
|
||||
}
|
||||
|
||||
/// Get the group-index.xml URL for a given group
|
||||
|
@ -63,9 +63,9 @@ fn get_groups_index_url(group: String) -> String {
|
|||
/// The group parameter is here only for logging purposes and may be removed
|
||||
/// at any time.
|
||||
#[cfg(not(test))]
|
||||
fn get_group_index(group: &str, url: &str) -> Result<String, reqwest::Error> {
|
||||
fn get_group_index(group: &str, url: &str) -> Result<String, std::io::Error> {
|
||||
info!("Getting index for {} from {}", group, url);
|
||||
reqwest::get(url)?.text()
|
||||
ureq::get(url).call().into_string()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user