Refactor: Make sure 'static Future is returned

To make it easier to create generic function

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-05-27 23:37:01 +10:00
parent c36145f2b4
commit cb418fda11
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928
3 changed files with 51 additions and 32 deletions

View file

@ -76,12 +76,14 @@ fn fetch_release_artifacts_restful_api(
) -> impl Future<Output = Result<Artifacts, GhApiError>> + Send + Sync + 'static {
issue_restful_api(
client,
format!(
"repos/{owner}/{repo}/releases/tags/{tag}",
owner = percent_encode_http_url_path(owner),
repo = percent_encode_http_url_path(repo),
tag = percent_encode_http_url_path(tag),
),
&[
"repos",
&percent_encode_http_url_path(owner).to_compact_string(),
&percent_encode_http_url_path(repo).to_compact_string(),
"releases",
"tags",
&percent_encode_http_url_path(tag).to_compact_string(),
],
auth_token,
)
}