liamzwbao commented on code in PR #8729:
URL: https://github.com/apache/arrow-rs/pull/8729#discussion_r2475863589
##########
parquet/src/encodings/rle.rs:
##########
@@ -321,14 +321,15 @@ impl RleDecoder {
}
#[inline]
- pub fn set_data(&mut self, data: Bytes) {
+ pub fn set_data(&mut self, data: Bytes) -> Result<()> {
if let Some(ref mut bit_reader) = self.bit_reader {
bit_reader.reset(data);
} else {
self.bit_reader = Some(BitReader::new(data));
}
- let _ = self.reload();
+ self.reload()?;
Review Comment:
`reload()` returns a bool, so if it’s `Ok()`, the return value is simply
ignored, but any error will still propagate with `?`.
In the old code, the return value was ignored and could potentially cause a
panic.
In the new code, the return value is still ignored, but it will return an
`Err` instead of crashing the program.
Might be better to keep the `let _ =` and add comments here
--
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]