etseidl commented on code in PR #9840:
URL: https://github.com/apache/arrow-rs/pull/9840#discussion_r3149693282
##########
parquet/src/file/metadata/thrift/mod.rs:
##########
@@ -1128,7 +1128,12 @@ impl DataPageHeaderV2 {
repetition_levels_byte_length = Some(val);
}
7 => {
- let val = field_ident.bool_val.unwrap();
+ let val = field_ident.bool_val.ok_or_else(|| {
Review Comment:
Wondering out loud if it's any better to just test `bool_val` and then
assign without unwrapping at all.
```rust
if field_ident.bool_val.is_none() {
return Err(general_err!(
"Expected bool field but got thrift type {:?}",
field_ident.field_type
));
}
is_compressed = field_ident.bool_val;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]