You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/02/20 14:11:46 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3734: replace for loop by try_for_each
tustvold commented on code in PR #3734:
URL: https://github.com/apache/arrow-rs/pull/3734#discussion_r1112006379
##########
arrow-csv/src/reader/mod.rs:
##########
@@ -866,21 +866,24 @@ fn parse_decimal_with_parameter<T: DecimalType>(
let mut negative = false;
let mut result = T::Native::usize_as(0);
- for byte in bytes[0..offset].iter().rev() {
- match byte {
+ bytes[0..offset]
+ .iter()
+ .rev()
+ .try_for_each::<_, Result<(), ArrowError>>(|&byte| match byte {
b'-' => {
negative = true;
+ Ok(())
Review Comment:
It might be cleaner to lift the `Ok(())` out of the match, but don't feel strongly
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org