Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad indentation of if ... else #438

Open
Chris00 opened this issue Jan 22, 2022 · 1 comment
Open

Bad indentation of if ... else #438

Chris00 opened this issue Jan 22, 2022 · 1 comment

Comments

@Chris00
Copy link
Contributor

Chris00 commented Jan 22, 2022

Example:

fn main() {
    let x =
        if 1 == 2 { 1 }
    else { 3};
}

It should be

fn main() {
    let x =
        if 1 == 2 { 1 }
        else { 3};
}
@Chris00
Copy link
Contributor Author

Chris00 commented Feb 2, 2022

As a variant of the above:

fn main() {
    let x = if test { then_clause }
    else { else_clause };
}

Another one (triggered it seems by the < of <=):

fn main() {
    let x = if 0. <= v { then_clause }
                  else { else_clause };
                  let y = 1;
                  f(y)
}

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

No branches or pull requests

2 participants