Cargo Fast Format (cargo-ff)
Drop-in replacement for cargo fmt. Same flags, byte-identical file output, ~5.5× faster on large
workspaces by parallelizing across crates.
Install
Usage
Same flags as cargo fmt:
Pre-commit hook
To make git commit fail on unformatted files:
[ ||
Experimental mtime cache
--ff-experimental-cache records each crate's *.rs mtimes after a successful run. On the next run,
crates whose fingerprint is unchanged are not dispatched to rustfmt at all. ~5× speedup on a clean
tree.
Cache lives at ~/.cache/cargo-ff/fingerprints.tsv, salted by the rustfmt --version output and
the workspace-root .rustfmt.toml. A mismatch on either invalidates everything.
Soundness caveat: cross-crate #[path = "../other/foo.rs"] references aren't tracked. If the
external file changes, we may falsely skip.