From 6b0f4602b98c84585df08b337881bbcf45b07a7a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Jun 2024 22:58:04 +1000 Subject: [PATCH] Add new API `GhApiClient::remote_client` Signed-off-by: Jiahao XU --- crates/binstalk-git-repo-api/src/gh_api_client.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 86a2e7b9..84f75890 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -131,6 +131,10 @@ impl GhApiClient { is_auth_token_valid: AtomicBool::new(true), })) } + + pub fn remote_client(&self) -> &remote::Client { + &self.0.client + } } impl GhApiClient { @@ -560,7 +564,7 @@ mod test { let browser_download_task = client.get_auth_token().map(|_| { tokio::spawn( Download::new( - client.0.client.clone(), + client.remote_client().clone(), Url::parse(&format!( "https://github.com/{}/{}/releases/download/{}/{}", artifact.release.repo.owner,