Skip to content

Commit

Permalink
chore: remove match arm
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Aug 23, 2024
1 parent 8982963 commit 53749f0
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions crates/core/src/logstore/default_logstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,24 @@ impl LogStore for DefaultLogStore {
commit_or_bytes: CommitOrBytes,
) -> Result<(), TransactionError> {
match commit_or_bytes {
CommitOrBytes::LogBytes(log_bytes) => {
match self
.object_store()
.put_opts(
&commit_uri_from_version(version),
log_bytes.into(),
put_options().clone(),
)
.await
{
Ok(_) => Ok(()),
Err(e) => Err(e),
}
}
CommitOrBytes::LogBytes(log_bytes) => self
.object_store()
.put_opts(
&commit_uri_from_version(version),
log_bytes.into(),
put_options().clone(),
)
.await
.map_err(|err| -> TransactionError {
match err {
ObjectStoreError::AlreadyExists { .. } => {
TransactionError::VersionAlreadyExists(version)
}
_ => TransactionError::from(err),
}
})?,
_ => unreachable!(), // Default log store should never get a tmp_commit, since this is for conditional put stores
}
.map_err(|err| -> TransactionError {
match err {
ObjectStoreError::AlreadyExists { .. } => {
TransactionError::VersionAlreadyExists(version)
}
_ => TransactionError::from(err),
}
})?;
};
Ok(())
}

Expand Down

0 comments on commit 53749f0

Please sign in to comment.