Skip to content

Commit

Permalink
Replace unwrap (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
odysa authored Feb 2, 2024
1 parent 9768b0e commit 9ae9e13
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/iceberg/src/spec/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ mod _const_schema {
])),
)),
];
let schema = Schema::builder().with_fields(fields).build().unwrap();
let schema = Schema::builder().with_fields(fields).build()?;
schema_to_avro_schema("manifest", &schema)
}

Expand Down
4 changes: 2 additions & 2 deletions crates/iceberg/src/spec/manifest_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ impl ManifestListWriter {
pub async fn close(self) -> Result<()> {
let data = self.avro_writer.into_inner()?;
let mut writer = self.output_file.writer().await?;
writer.write_all(&data).await.unwrap();
writer.close().await.unwrap();
writer.write_all(&data).await?;
writer.close().await?;
Ok(())
}
}
Expand Down
16 changes: 8 additions & 8 deletions crates/iceberg/src/spec/table_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ pub(super) mod _serde {
schema: v
.schemas
.get(&v.current_schema_id)
.unwrap()
.expect("current_schema_id not found in schemas")
.as_ref()
.clone()
.into(),
Expand Down Expand Up @@ -867,12 +867,12 @@ mod tests {
{
"spec-id": 1,
"fields": [
{
"source-id": 4,
"field-id": 1000,
"name": "ts_day",
{
"source-id": 4,
"field-id": 1000,
"name": "ts_day",
"transform": "day"
}
}
]
}
],
Expand All @@ -882,8 +882,8 @@ mod tests {
"commit.retry.num-retries": "1"
},
"metadata-log": [
{
"metadata-file": "s3://bucket/.../v1.json",
{
"metadata-file": "s3://bucket/.../v1.json",
"timestamp-ms": 1515100
}
],
Expand Down
2 changes: 1 addition & 1 deletion crates/iceberg/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl<'a> ReplaceSortOrderAction<'a> {
.table
.metadata()
.default_sort_order()
.unwrap()
.expect("default sort order impossible to be None")
.order_id,
},
];
Expand Down

0 comments on commit 9ae9e13

Please sign in to comment.