Skip to content

Commit

Permalink
warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
paraseba committed Dec 10, 2024
1 parent 24599bd commit 91b06dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion icechunk/src/storage/object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ impl Storage for ObjectStorage {
let options = PutOptions { mode, attributes, ..PutOptions::default() };
let res = self.store.put_opts(&path, config.into(), options).await;
match res {
Ok(res) => Ok(res.e_tag.expect("Object should have an etag")),
Ok(res) => {
let etag = res.e_tag.ok_or(StorageError::Other(
"Config object should have an etag".to_string(),
))?;
Ok(etag)
}
Err(object_store::Error::Precondition { .. }) => {
Err(StorageError::ConfigUpdateConflict)
}
Expand Down
7 changes: 6 additions & 1 deletion icechunk/src/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ impl Storage for S3Storage {
let res = req.send().await;

match res {
Ok(out) => Ok(out.e_tag().expect("Object should have an etag").to_string()),
Ok(out) => {
let etag = out.e_tag().ok_or(StorageError::Other(
"Config object should have an etag".to_string(),
))?;
Ok(etag.to_string())
}
// minio returns this
Err(SdkError::ServiceError(err)) => {
if err.err().meta().code() == Some("PreconditionFailed") {
Expand Down

0 comments on commit 91b06dc

Please sign in to comment.