Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Mar 19, 2021

Master has some lint failures:
https://github.com/apache/arrow/pull/9749/checks?check_run_id=2144048180

error: this `else { if .. }` block can be collapsed
   --> arrow/src/array/array_binary.rs:427:20
    |
427 |               } else {
    |  ____________________^
428 | |                 if let Some(size) = size {
429 | |                     buffer.extend_zeros(size);
430 | |                 } else {
431 | |                     prepend += 1;
432 | |                 }
433 | |             }
    | |_____________^
    |
    = note: `-D clippy::collapsible-if` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
    |
427 |             } else if let Some(size) = size {
428 |                 buffer.extend_zeros(size);
429 |             } else {
430 |                 prepend += 1;
431 |             }
    |

Intrpduced in #9647 / 775a714 (though I had problems reproducing this locally)

Copy link
Contributor

@nevi-me nevi-me left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb I snuck in the fix here: ef64d00

Doesn't moving the 2 lines from the else change the logic?

@alamb
Copy link
Contributor Author

alamb commented Mar 19, 2021

Doesn't moving the 2 lines from the else change the logic?

Yes, I believe it does. 🤦 Thanks @nevi-me

@alamb alamb closed this Mar 19, 2021
@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants