Skip to content

Poor line breaking of multi-item type parameter bounds featuring bracketed generic arguments #3599

@mzabaluev

Description

@mzabaluev

This is how rustfmt formats a long list of type parameter bounds featuring a long list of bracketed generic arguments:

    type ProposeTransactionsFuture: Future<
            Item = ProposeTransactionsResponse<Self::MessageId>,
            Error = Error,
        > + Send
        + 'static;

The first bound after the closing bracket is formatted inline and is visually obscured.
It would be better to break and align the top-level + separators:

    type ProposeTransactionsFuture: Future<
            Item = ProposeTransactionsResponse<Self::MessageId>,
            Error = Error,
        >
        + Send
        + 'static;

Edit: Or better yet, on suggestion by @topecongiro below:

    type ProposeTransactionsFuture:
        Future<
            Item = ProposeTransactionsResponse<Self::MessageId>,
            Error = Error,
        >
        + Send
        + 'static;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions