Jefffrey commented on code in PR #11369:
URL: https://github.com/apache/arrow-rs/pull/11369#discussion_r4177426461


##########
arrow-cast/src/cast/decimal.rs:
##########
@@ -783,11 +784,8 @@ where
                     if array.is_null(i) {
                         value_builder.append_null();
                     } else {
-                        let v = array
-                            .value(i)
-                            .div_checked(div)
-                            .ok()
-                            .and_then(<T::Native as 
NumCast>::from::<D::Native>);
+                        let v = array.value(i).div_wrapping(div);

Review Comment:
   `div` here cannot be 0 and can never be negative (its calculated from a 
power of 10), so integer division can never fail
   
   same goes for all the other cases below



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