Skip to content

Instantly share code, notes, and snippets.

@ashleygwilliams
Created July 10, 2018 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleygwilliams/3aba2a930adf312f12ba00f31979184b to your computer and use it in GitHub Desktop.
Save ashleygwilliams/3aba2a930adf312f12ba00f31979184b to your computer and use it in GitHub Desktop.

Configuring rustfmt

Before submitting code in a PR, make sure that you have formatted the codebase using rustfmt. rustfmt is a tool for formatting Rust code, which helps keep style consistent across the project. If you have not used rustfmt before, it is not too difficult.

If you have not already configured rustfmt for the nightly toolchain, it can be done using the following steps:

1. Use Nightly Toolchain

Use the rustup override command to make sure that you are using the nightly toolchain. Run this command in the wasm-pack directory you cloned.

rustup override set nightly

2. Add the rustfmt component

Install the most recent version of rustfmt using this command:

rustup component add rustfmt-preview --toolchain nightly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment