You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2026/08/18 20:42:27 UTC

[PR] Fix `clippy::return_and_then` lint from Rust 1.97 [arrow-rs]

alamb opened a new pull request, #10743:
URL: https://github.com/apache/arrow-rs/pull/10743

   # Which issue does this PR close?
   
   N/A -- fixes CI on main
   
   # Rationale for this change
   
   CI clippy jobs on main are failing, e.g. https://github.com/apache/arrow-rs/actions/runs/32180217000/job/95851222817
   
   This is not due to any recent code change: CI uses the latest stable Rust, and the new Rust 1.97 release promoted the [`clippy::return_and_then`](https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#return_and_then) lint, which now fires on one closure in `parquet/src/arrow/arrow_reader/statistics.rs`:
   
   ```text
   error: use the `?` operator instead of an `and_then` call
       --> parquet/src/arrow/arrow_reader/statistics.rs:1841:22
        |
   1841 |             .map(|s| s.and_then(|s| s.distinct_count_opt()));
        |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ```
   
   # What changes are included in this PR?
   
   Rewrite the closure to use the `?` operator as clippy suggests (semantically identical, no behavior change):
   
   ```rust
   .map(|s| s?.distinct_count_opt());
   ```
   
   I verified locally with clippy 1.97 that this is the only new lint error across the entire workspace (`cargo clippy --workspace --all-targets --all-features -- -D warnings` now passes).


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


Re: [PR] Fix `clippy::return_and_then` lint from Rust 1.97 [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10743:
URL: https://github.com/apache/arrow-rs/pull/10743#issuecomment-5334499973

   Thank you for the review @etseidl 


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


Re: [PR] Fix `clippy::return_and_then` lint from Rust 1.97 [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #10743:
URL: https://github.com/apache/arrow-rs/pull/10743


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