Refactor: Replace REQWESTCONFIG with initialize_reqwest_client

so that we don't need two `OnceCell`s.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-01 00:14:50 +10:00
parent 50b436100e
commit 6582eefd25
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
3 changed files with 29 additions and 34 deletions

View file

@ -200,13 +200,8 @@ async fn entry() -> Result<()> {
bin_dir: opts.bin_dir.take(),
};
// Initialize REQWESTGLOBALCONFIG
REQWESTGLOBALCONFIG
.set(ReqwestConfig {
secure: opts.secure,
min_tls: opts.min_tls_version.map(|v| v.into()),
})
.unwrap();
// Initialize reqwest client
initialize_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?;
// Setup logging
let mut log_config = ConfigBuilder::new();