Skip to content

Commit

Permalink
fix: Remove Arc from xrpc-clients (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
sugyan authored Jul 28, 2024
1 parent 75673d0 commit af69f1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions atrium-xrpc-client/src/isahc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::sync::Arc;
#[derive(Clone)]
pub struct IsahcClient {
base_uri: String,
client: Arc<Client>,
client: Client,
}

impl IsahcClient {
Expand Down Expand Up @@ -50,10 +50,9 @@ impl IsahcClientBuilder {
pub fn build(self) -> IsahcClient {
IsahcClient {
base_uri: self.base_uri,
client: Arc::new(
self.client
.unwrap_or(Client::new().expect("failed to create isahc client")),
),
client: self
.client
.unwrap_or(Client::new().expect("failed to create isahc client")),
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions atrium-xrpc-client/src/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use async_trait::async_trait;
use atrium_xrpc::http::{Request, Response};
use atrium_xrpc::{HttpClient, XrpcClient};
use reqwest::Client;
use std::sync::Arc;

/// A [`reqwest`] based asynchronous client to make XRPC requests with.
///
Expand All @@ -17,7 +16,7 @@ use std::sync::Arc;
#[derive(Clone)]
pub struct ReqwestClient {
base_uri: String,
client: Arc<Client>,
client: Client,
}

impl ReqwestClient {
Expand Down Expand Up @@ -50,7 +49,7 @@ impl ReqwestClientBuilder {
pub fn build(self) -> ReqwestClient {
ReqwestClient {
base_uri: self.base_uri,
client: Arc::new(self.client.unwrap_or_default()),
client: self.client.unwrap_or_default(),
}
}
}
Expand Down

0 comments on commit af69f1b

Please sign in to comment.