From 962a7d057c1c8f818675f94e4189549694f9a8d9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 28 May 2024 22:51:27 +1000 Subject: [PATCH] Fix `cargo test` run on CI `cargo test` run all tests in one process. As such, `set_global_default` would fail on the second call. Signed-off-by: Jiahao XU --- crates/binstalk-git-repo-api/src/gh_api_client.rs | 3 ++- 1 file changed, 2 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 08d75597..b088a9e3 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -149,6 +149,7 @@ impl GhApiClient { Ok(()) } + async fn do_fetch( &self, graphql_func: GraphQLFn, @@ -345,7 +346,7 @@ mod test { .finish(); // Setup global subscriber - set_global_default(subscriber).unwrap(); + let _ = set_global_default(subscriber); } /// Mark this as an async fn so that you won't accidentally use it in