January 2019
Intermediate to advanced
520 pages
14h 32m
English
Since rustfmt was added as a command, using it is as simple as calling a special command:
cargo fmt
This command fixes all sources to default style guidelines. But it works quietly and we have to look at the differences between files to see the changes.
But we will use this tool to check the code styles with CI, and stop building if the code was formatted incorrectly. To check the code and also to see potential changes, you have to pass the --check argument to rustfmt:
cargo fmt -- --check
As you can see, we used an extra -- parameter, because without it, we pass arguments to a tool that calls rustfmt, but to send ...
Read now
Unlock full access