mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-16 15:46:36 +00:00
Fix binstalk-git-repo-api
Remove `Sync` bound on returned `Future`, since `tokio::spawn` does not require it Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
da9de8f14c
commit
54e6ca768f
4 changed files with 8 additions and 8 deletions
|
@ -204,8 +204,8 @@ impl GhApiClient {
|
||||||
where
|
where
|
||||||
GraphQLFn: Fn(&remote::Client, &T, &str) -> GraphQLFut,
|
GraphQLFn: Fn(&remote::Client, &T, &str) -> GraphQLFut,
|
||||||
RestfulFn: Fn(&remote::Client, &T, Option<&str>) -> RestfulFut,
|
RestfulFn: Fn(&remote::Client, &T, Option<&str>) -> RestfulFut,
|
||||||
GraphQLFut: Future<Output = Result<U, GhApiError>> + Send + Sync + 'static,
|
GraphQLFut: Future<Output = Result<U, GhApiError>> + Send + 'static,
|
||||||
RestfulFut: Future<Output = Result<U, GhApiError>> + Send + Sync + 'static,
|
RestfulFut: Future<Output = Result<U, GhApiError>> + Send + 'static,
|
||||||
{
|
{
|
||||||
self.check_retry_after()?;
|
self.check_retry_after()?;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ pub(super) fn issue_restful_api<T>(
|
||||||
client: &remote::Client,
|
client: &remote::Client,
|
||||||
path: &[&str],
|
path: &[&str],
|
||||||
auth_token: Option<&str>,
|
auth_token: Option<&str>,
|
||||||
) -> impl Future<Output = Result<T, GhApiError>> + Send + Sync + 'static
|
) -> impl Future<Output = Result<T, GhApiError>> + Send + 'static
|
||||||
where
|
where
|
||||||
T: DeserializeOwned,
|
T: DeserializeOwned,
|
||||||
{
|
{
|
||||||
|
@ -95,7 +95,7 @@ pub(super) fn issue_graphql_query<T>(
|
||||||
client: &remote::Client,
|
client: &remote::Client,
|
||||||
query: String,
|
query: String,
|
||||||
auth_token: &str,
|
auth_token: &str,
|
||||||
) -> impl Future<Output = Result<T, GhApiError>> + Send + Sync + 'static
|
) -> impl Future<Output = Result<T, GhApiError>> + Send + 'static
|
||||||
where
|
where
|
||||||
T: DeserializeOwned + Debug,
|
T: DeserializeOwned + Debug,
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,7 +74,7 @@ pub(super) fn fetch_release_artifacts_restful_api(
|
||||||
tag,
|
tag,
|
||||||
}: &GhRelease,
|
}: &GhRelease,
|
||||||
auth_token: Option<&str>,
|
auth_token: Option<&str>,
|
||||||
) -> impl Future<Output = Result<Artifacts, GhApiError>> + Send + Sync + 'static {
|
) -> impl Future<Output = Result<Artifacts, GhApiError>> + Send + 'static {
|
||||||
issue_restful_api(
|
issue_restful_api(
|
||||||
client,
|
client,
|
||||||
&["repos", owner, repo, "releases", "tags", tag],
|
&["repos", owner, repo, "releases", "tags", tag],
|
||||||
|
@ -135,7 +135,7 @@ pub(super) fn fetch_release_artifacts_graphql_api(
|
||||||
tag,
|
tag,
|
||||||
}: &GhRelease,
|
}: &GhRelease,
|
||||||
auth_token: &str,
|
auth_token: &str,
|
||||||
) -> impl Future<Output = Result<Artifacts, GhApiError>> + Send + Sync + 'static {
|
) -> impl Future<Output = Result<Artifacts, GhApiError>> + Send + 'static {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
let auth_token = auth_token.to_compact_string();
|
let auth_token = auth_token.to_compact_string();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ pub(super) fn fetch_repo_info_restful_api(
|
||||||
client: &remote::Client,
|
client: &remote::Client,
|
||||||
GhRepo { owner, repo }: &GhRepo,
|
GhRepo { owner, repo }: &GhRepo,
|
||||||
auth_token: Option<&str>,
|
auth_token: Option<&str>,
|
||||||
) -> impl Future<Output = Result<Option<RepoInfo>, GhApiError>> + Send + Sync + 'static {
|
) -> impl Future<Output = Result<Option<RepoInfo>, GhApiError>> + Send + 'static {
|
||||||
issue_restful_api(client, &["repos", owner, repo], auth_token)
|
issue_restful_api(client, &["repos", owner, repo], auth_token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ pub(super) fn fetch_repo_info_graphql_api(
|
||||||
client: &remote::Client,
|
client: &remote::Client,
|
||||||
GhRepo { owner, repo }: &GhRepo,
|
GhRepo { owner, repo }: &GhRepo,
|
||||||
auth_token: &str,
|
auth_token: &str,
|
||||||
) -> impl Future<Output = Result<Option<RepoInfo>, GhApiError>> + Send + Sync + 'static {
|
) -> impl Future<Output = Result<Option<RepoInfo>, GhApiError>> + Send + 'static {
|
||||||
let query = format!(
|
let query = format!(
|
||||||
r#"
|
r#"
|
||||||
query {{
|
query {{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue