From f352f38b4e3a81ed89a5f6d055da818117a62d59 Mon Sep 17 00:00:00 2001 From: Jonathan <30177086+MonliH@users.noreply.github.com> Date: Sun, 11 Oct 2020 16:28:45 +0000 Subject: [PATCH] Document RUSTFMT environment variable (#4464) * Document RUSTFMT env var * Move documentation up * Apply suggestions from code review Co-authored-by: Caleb Cartwright * Fix accedental removal Co-authored-by: Caleb Cartwright --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e34b95e1613..ff97ccf4733 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ The easiest way to run rustfmt against a project is with `cargo fmt`. `cargo fmt single-crate projects and [cargo workspaces](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html). Please see `cargo fmt --help` for usage information. +You can specify the path to your own `rustfmt` binary for cargo to use by setting the`RUSTFMT` +environment variable. This was added in v1.4.22, so you must have this version or newer to leverage this feature (`cargo fmt --version`) + ### Running `rustfmt` directly To format individual files or arbitrary codes from stdin, the `rustfmt` binary should be used. Some