Skip to content

Feature request: Add the option to configure rustfmt in the Cargo.toml metadata tables #6296

Closed as not planned
@J-Westin

Description

@J-Westin

The Cargo.toml specification includes [project.metadata] and [workspace.metadata] tables, which allows external tools to store arbitrary data. These tables could be used to configure rustfmt, in addition to the existing .rustfmt.toml and rustfmt.toml files.

Configuration data for rustfmt, in the same format used in the existing .toml files, could be read from the [package.metadata.rustfmt] table. The following rustfmt.toml file:

max_width = 79

would be equivalent to the following Cargo.toml:

[package]
# ...

[dependencies]
# ...

[package.metadata.rustfmt]
max_width = 79

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