mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Reuse reqwest client in crates_io_api::AsyncClient
(#349)
This commit is contained in:
parent
e7d2eb1aef
commit
f7ad78288b
4 changed files with 132 additions and 125 deletions
|
@ -20,7 +20,7 @@ pkg-fmt = "zip"
|
|||
[dependencies]
|
||||
binstall = { path = "../lib", version = "0.0.0" }
|
||||
clap = { version = "3.2.17", features = ["derive"] }
|
||||
crates_io_api = { version = "0.8.0", default-features = false }
|
||||
crates_io_api = { version = "0.8.1", default-features = false }
|
||||
dirs = "4.0.0"
|
||||
log = "0.4.17"
|
||||
miette = "5.3.0"
|
||||
|
|
|
@ -35,11 +35,8 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien
|
|||
let client = create_reqwest_client(args.min_tls_version.map(|v| v.into()))?;
|
||||
|
||||
// Build crates.io api client
|
||||
let crates_io_api_client = crates_io_api::AsyncClient::new(
|
||||
"cargo-binstall (https://github.com/ryankurte/cargo-binstall)",
|
||||
Duration::from_millis(100),
|
||||
)
|
||||
.expect("bug: invalid user agent");
|
||||
let crates_io_api_client =
|
||||
crates_io_api::AsyncClient::with_http_client(client.clone(), Duration::from_millis(100));
|
||||
|
||||
// Initialize UI thread
|
||||
let mut uithread = UIThread::new(!args.no_confirm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue