Hi, guys. How i can start use rustfmt? Thanks
Hi There
Your question is too generic. I have 3 questions for you:
- Have you gone through the documentation?
- Is there any specific thing you are having an issue with on how to use rustfmt as explained in the doc?
- Have you tried doing it and got stuck somewhere?
3 Likes
Sorry, I thought that this documentation (repository) is not official. It would be nice if it was shipped with Rust and was run by a simple rustfmt command for example.
1 Like
As of the next release, it will be on the stable channel. Until then, you can install it on the nightly channel as described here: GitHub - rust-lang/rustfmt: Format Rust code
One command is one more than "included by default", but we're just not ready yet.
cargo fmt
is only one character longer, thanks to the space
5 Likes
It is rather complex.
At now you should use beta
variant of compiler:
rustup default beta
then make sure that rustfmt installed:
rustup component add --toolchain beta rustfmt-preview
at now rustfmt
and cargo fmt
should works.
4 Likes