Skip to content

Let-Else is not formated correctly after else #5660

Description

@erwanvivien
fn main() {
    let position:      Option<usize> = None;
    let mut normal: Option<usize> =  None;
    let mut tex_coords: Option<usize>    = None;

    let (Some( position), Some(    normal), Some(tex_coords  )) = (position, normal, tex_coords) else {
        return;
 };
 }

Does not format the let-else at all, resulting in:

fn main() {
    let position: Option<usize> = None;
    let mut normal: Option<usize> = None;
    let mut tex_coords: Option<usize> = None;

    let (Some( position), Some(    normal), Some(tex_coords  )) = (position, normal, tex_coords) else {
        return;
 };

}
# How to reproduce
$ rustfmt .\src\main.rs

Version:

$ rustfmt --version
rustfmt 1.5.1-stable (897e3755 2022-11-02)

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions