Skip to content

Consider putting (slightly longer) struct literals on one line #483

Closed
@hanna-kruppe

Description

@hanna-kruppe

A variant of #418 for proper structs instead of structvariants, inspired by rust-lang/rust#29113 where the diff contains many slight variations of:

-            Formatted { sign: sign, parts: &parts[..1] }
+            Formatted {
+                sign: sign,
+                parts: &parts[..1],
+            }

@marcusklaas assured me that this only happens to "bodies longer than 20 chars", I would prefer if that number was increased (by default - I was told it is configurable). A more complicated heuristic taking the total line length or the number/complexity of the field values into account might also make sense. I can see the benefit of breaking large, complicated literals, but essentially spending four lines of screen real estate on two simple expressions is overkill.

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