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

Format let_else/let else #5587

Closed
cynecx opened this issue Nov 4, 2022 · 3 comments
Closed

Format let_else/let else #5587

cynecx opened this issue Nov 4, 2022 · 3 comments

Comments

@cynecx
Copy link

cynecx commented Nov 4, 2022

It seems like rustfmt doesn't support formatting let_else/"let else" constructs right now.

fn main() {
    let Some(okay) = Some(1) else {
                            let t =             1;
                    return;
    };
}

I also couldn't find an existing issue around let_else (searched for "let else" and "let_else"), so let me know if this is an existing issue that I wasn't able to find.

@cynecx cynecx changed the title Formatlet_else/let else Format let_else/let else Nov 4, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Nov 4, 2022

Thanks for reaching out. rustfmt doesn't handle let-else formatting because the rules for how it should be formatted are still being discussed in rust-lang/style-team#165

You might also want to follow #4914 to keep track of the implementation on the rustfmt side once the rules have been codified in the fmt-rfc linked above.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 4, 2022
@cynecx
Copy link
Author

cynecx commented Nov 4, 2022

@ytmimi Oh dang! I was searching for "let else" and "let_else" and not "let-else". Do you mind adding "let_else" (and "let else") to the title of that issue so other lost minds have it easier finding that issue? :)

@ytmimi
Copy link
Contributor

ytmimi commented Nov 4, 2022

No worries, it can definitely be challenging to sift through the backlog. I struggle to track down issues I know are there all the time 😅

I'm surprised "let else" didn't work. This is what I got when I search for "let else" (2nd result)

Screen Shot 2022-11-04 at 12 57 18 PM

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

No branches or pull requests

2 participants