alamb commented on code in PR #4681:
URL: https://github.com/apache/arrow-rs/pull/4681#discussion_r1297148494


##########
arrow-data/src/data.rs:
##########
@@ -1589,10 +1611,13 @@ pub struct DataTypeLayout {
 }
 
 impl DataTypeLayout {
-    /// Describes a basic numeric array where each element has a fixed width
-    pub fn new_fixed_width(byte_width: usize) -> Self {
+    /// Describes a basic numeric array where each element has type `T`
+    pub fn new_fixed_width<T>() -> Self {
         Self {
-            buffers: vec![BufferSpec::FixedWidth { byte_width }],
+            buffers: vec![BufferSpec::FixedWidth {
+                byte_width: mem::size_of::<T>(),
+                alignment: mem::align_of::<T>(),

Review Comment:
   I think the documentation added in 
https://github.com/apache/arrow-rs/pull/4681/commits/ff6af65221f721d95c610f7bf99a69efcd320da3
 make the behavior in this PR much clearer. 
   
   Thank you



-- 
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]

Reply via email to