Closed
Description
Consider a freshly cargo init
-ed project with an added .rustfmt.toml
.
├── .rustfmt.toml
├── Cargo.toml
└── src
└── main.rs
In this case the format config is picked up as usual and when formatting main.rs
is formatted according to the configuration file.
Now consider a project where this rust project lives in a subdirectory
.
└── project
├── .rustfmt.toml
├── Cargo.toml
├── LICENSE
└── src
└── main.rs
In this case the configuration file is not picked up, and I have to symlink it to the root as a workaround or open it separately so that project
is the root. I suggest calling rustfmt
from the directory of the formatted .rs
file instead of the project root.