Skip to content

Commit

Permalink
fix: rename copy_with_transaction to clone_with_transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
fMeow committed Mar 28, 2021
1 parent 2c81c78 commit bda9457
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/custom_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ClientExt for ReqwestClient {
.map_err(|e| ClientError::HttpClient(format!("{:?}", e)))
}

fn copy_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
fn clone_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
let request = self.0.get("/").build().unwrap();
let original_headers = request.headers();
let mut headers = HeaderMap::new();
Expand Down
2 changes: 1 addition & 1 deletion src/client/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl ClientExt for ReqwestClient {
.map_err(|e| ClientError::HttpClient(format!("{:?}", e)))
}

fn copy_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
fn clone_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
let mut headers = HeaderMap::new();
for (name, value) in self.headers.iter() {
headers.insert(name, value.clone());
Expand Down
2 changes: 1 addition & 1 deletion src/client/surf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl ClientExt for SurfClient {
Ok(SurfClient { headers })
}

fn copy_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
fn clone_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
let mut headers = HeaderMap::new();
for (name, value) in self.headers.iter() {
headers.insert(name, value.clone());
Expand Down
2 changes: 1 addition & 1 deletion src/collection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ impl<'a, C: ClientExt> Collection<C> {
/// Returns a new Collection with its `session` updated with the transaction id
pub fn clone_with_transaction(&self, transaction_id: String) -> Result<Self, ClientError> {
Ok(Self {
session: Arc::new(self.session.copy_with_transaction(transaction_id)?),
session: Arc::new(self.session.clone_with_transaction(transaction_id)?),
..self.clone()
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ impl<'a, C: ClientExt> Database<C> {
let tx_id = transaction.id.clone();
Ok(Transaction::<C>::new(
transaction,
Arc::new(self.session.copy_with_transaction(tx_id)?),
Arc::new(self.session.clone_with_transaction(tx_id)?),
self.base_url.clone(),
))
}
Expand Down

0 comments on commit bda9457

Please sign in to comment.