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 <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-05-28 22:51:27 +10:00
parent ffe47d30c6
commit 962a7d057c
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928

View file

@ -149,6 +149,7 @@ impl GhApiClient {
Ok(()) Ok(())
} }
async fn do_fetch<T, U, GraphQLFn, RestfulFn, GraphQLFut, RestfulFut>( async fn do_fetch<T, U, GraphQLFn, RestfulFn, GraphQLFut, RestfulFut>(
&self, &self,
graphql_func: GraphQLFn, graphql_func: GraphQLFn,
@ -345,7 +346,7 @@ mod test {
.finish(); .finish();
// Setup global subscriber // 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 /// Mark this as an async fn so that you won't accidentally use it in