Skip to content

chore: delete redundant async #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: delete redundant async
  • Loading branch information
va-an committed Feb 23, 2025
commit c31890dc464436b0d66a72355135e830d8104912
2 changes: 1 addition & 1 deletion src/client/async_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Client {
client: HttpClient,
}

pub async fn client<C: Into<ClientOptions>>(options: C) -> Client {
pub fn client<C: Into<ClientOptions>>(options: C) -> Client {
let options = options.into();
let client = HttpClient::builder()
.timeout(Duration::from_secs(options.request_timeout_seconds))
Expand Down
5 changes: 3 additions & 2 deletions src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ static GLOBAL_CLIENT: OnceLock<Client> = OnceLock::new();
static GLOBAL_DISABLE: OnceLock<bool> = OnceLock::new();

#[cfg(feature = "async-client")]
pub async fn init_global_client<C: Into<ClientOptions>>(options: C) -> Result<(), Error> {
pub fn init_global_client<C: Into<ClientOptions>>(options: C) -> Result<(), Error> {
if is_disabled() {
return Ok(());
}

let client = client(options).await;
let client = client(options);

GLOBAL_CLIENT
.set(client)
.map_err(|_| Error::AlreadyInitialized)
Expand Down