Refactor: Rm global var helpers::CLIENT

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-10 18:07:07 +10:00
parent 3c06c45792
commit fa63dbe5cf
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
6 changed files with 42 additions and 36 deletions

View file

@ -4,6 +4,7 @@ use std::sync::Arc;
pub use gh_crate_meta::*;
pub use log::debug;
pub use quickinstall::*;
use reqwest::Client;
use crate::{AutoAbortJoinHandle, BinstallError, PkgFmt, PkgMeta};
@ -13,7 +14,7 @@ mod quickinstall;
#[async_trait::async_trait]
pub trait Fetcher: Send + Sync {
/// Create a new fetcher from some data
async fn new(data: &Data) -> Arc<Self>
async fn new(client: &Client, data: &Data) -> Arc<Self>
where
Self: Sized;