isidentical opened a new issue, #3597:
URL: https://github.com/apache/arrow-datafusion/issues/3597

   **Describe the bug**
   Seems like there are a few places in the codebase where clippy now starts to 
be noticing problems, and it is making lint checks fail across all new PRs (and 
the master)
   
   The new lint errors looks reasonable to me, so we should be able to fix all 
three by removing the closures.
   ```
   error: unnecessary closure used with `bool::then`
     --> datafusion/core/src/physical_plan/file_format/delimited_stream.rs:71:17
      |
   71 |                 (*v == NEWLINE).then(|| idx + 1)
      |                 ^^^^^^^^^^^^^^^^----------------
      |                                 |
      |                                 help: use `then_some(..)` instead: 
`then_some(idx + 1)`
      |
      = note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
      = help: for further information visit 
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   
   error: unnecessary closure used with `bool::then`
       --> datafusion/core/src/physical_plan/hash_join.rs:1243:33
        |
   1243 |                 .filter_map(|v| 
(!visited_left_side.get_bit(v)).then(|| v as u64)),
        |                                 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------
        |                                                                 |
        |                                                                 help: 
use `then_some(..)` instead: `then_some(v as u64)`
        |
        = help: for further information visit 
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   
   error: unnecessary closure used with `bool::then`
       --> datafusion/core/src/physical_plan/hash_join.rs:1248:33
        |
   1248 |                 .filter_map(|v| 
(visited_left_side.get_bit(v)).then(|| v as u64)),
        |                                 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------
        |                                                                |
        |                                                                help: 
use `then_some(..)` instead: `then_some(v as u64)`
        |
        = help: for further information visit 
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   ```
   


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