Skip to content

struct patterns eagerly split across lines in the default configuration #2062

Closed
@nikomatsakis

Description

@nikomatsakis

Unless struct patterns contain only shorthand variables, they seem to almost always split across multiple lines -- I find this a bit over-eager. For example:

fn foo() {
    let Answer { subst, ambiguous: _ } = some_struct;
}

formats to:

fn foo() {
    let Answer {
        subst,
        ambiguous: _,
    } = some_struct;
}

which seems unnecessary. I tend to use a lot of struct unpacking like that as a way to ensure that if new fields are added I will get compliation errors. Spreading things across multiple lines here makes my code quite spread out vertically.

Sorry if I'm duplicating things! I did a brief search over the issues and didn't find an obvious duplicate.

Version: 0.2.8-nightly ( )
Configuration: None

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