Hacker News new | ask | show | jobs
by hobofan 37 days ago
For cargo, not quite.

rustfmt is what implements Rust formating. However rustfmt is also distributed via rustup (Rust's toolchain manager). There it is also exposed under the alias cargo-fmt, which makes it work as cargo subcommand `cargo fmt` (a mechanism that's available to any crate). So it's technically not "part of cargo".

Of course the nature of all of this is a bit different, as Rust maintains cargo, rustfmt and a lot more dev tooling as part of it's official teams in comparison to other language ecosystems, where focus is on the compiler only.

1 comments

From a user's point of view and an operational standpoint, that is how they work. Mix is the same way in terms of calling tools as subcommands. But it doesn't matter. You get a default experience with `cargo` and `mix` driving everything.