viirya commented on code in PR #2471:
URL: https://github.com/apache/arrow-rs/pull/2471#discussion_r947404192
##########
parquet/src/data_type.rs:
##########
@@ -36,29 +36,27 @@ use crate::util::{
/// Rust representation for logical type INT96, value is backed by an array of
`u32`.
/// The type only takes 12 bytes, without extra padding.
-#[derive(Clone, Debug, PartialOrd, Default)]
+#[derive(Clone, Debug, PartialOrd, Default, PartialEq, Eq)]
pub struct Int96 {
- value: Option<[u32; 3]>,
+ value: [u32; 3],
}
impl Int96 {
/// Creates new INT96 type struct with no data set.
pub fn new() -> Self {
- Self { value: None }
+ Self { value: [0; 3] }
}
/// Returns underlying data as slice of [`u32`].
#[inline]
pub fn data(&self) -> &[u32] {
- self.value
- .as_ref()
- .expect("set_data should have been called")
Review Comment:
I guess that it originally wants to make sure `data` is already returns
something set instead of an initial value.
--
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]