Skip to content

New clippy errors appears to be break the CI on the master #3597

@isidentical

Description

@isidentical

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions