Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Oct 1, 2025

Example

fn f() {
    if cond {
        3 * 2
    } e$0lse {
        1
    }
}

->

fn f() {
    if !cond {
        1
    } else {
        3 * 2
    }
}

Example
---
```rust
fn f() {
    if cond {
        3 * 2
    } e$0lse {
        1
    }
}
```
->
```rust
fn f() {
    if !cond {
        1
    } else {
        3 * 2
    }
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 1, 2025
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

I'm not sure it's better, but it's also not particularly worse.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Oct 22, 2025
Merged via the queue into rust-lang:master with commit 9fd6be3 Oct 22, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 22, 2025
@A4-Tacks A4-Tacks deleted the else-kw-invert-if branch October 22, 2025 03:17
@lnicola lnicola changed the title Add applicable on else for invert_if fix: offer invert_if on else Oct 24, 2025
mendelsshop pushed a commit to mendelsshop/rust-analyzer that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants