Skip to content

ifs_same_condition not considering inferred types #468

@wawel37

Description

@wawel37

We are getting:

warn: Plugin diagnostic: Consecutive `if` with the same condition found.

for

if let Some(point_box) = sample_values_at_column.try_into() {   
   let [point_sample]: [QM31; 1] = (*point_box).unbox();
   ...                  
} else if let Some(tuple_box) = sample_values_at_column.try_into() {
   let [prev_point_sample, point_sample]: [QM31; 2] = (*tuple_box).unbox();
   ...
}

The first branch is getting the TryInto<Span<T>, @Box<[T; 1]>>, and the second one is getting TryInto<Span<T>, @Box<[T; 2]>>.

AC:

  • Verify if it's expected to throw that diagnostic here.
  • If not, fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Backlog Lint

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions