From 4e89f3d68e1952f4ef962c5f59ef3fb44815a929 Mon Sep 17 00:00:00 2001 From: Sergei Kharchikov Date: Fri, 31 Jan 2025 17:35:34 +0000 Subject: [PATCH] question #1 --- src/service/github.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/service/github.rs b/src/service/github.rs index 47eef34..b1097fa 100644 --- a/src/service/github.rs +++ b/src/service/github.rs @@ -87,10 +87,21 @@ impl GithubExt for Github { .unwrap_or_default(); let mut result = vec![]; + // why I can't use JoinSet here? + // error: temporary value dropped while borrowed + // let mut tasks = JoinSet::new(); + // + // for variables in variables { + // let task = post_graphql::( + // &self.client, + // &self.graphql_url(), + // variables, + // ); + // tasks.spawn(task); + // } + // let result = tasks.join_all().await; - // I had an error when I tried to use JoinSet here, so I had to use a for loop - // temporary v for variables in variables { let response = post_graphql::( &self.client,