Document the need for `rustfmt` when contributing in the README
@@ -54,3 +54,18 @@ cd test_module
npm run build
npm test
```
+
+## Contributing
+
+The bindings files (`src/sys/bindings.rs`) are generated by [bindgen][]. However, the code it produces is garbled, so [rustfmt][] is run on it to make it more readable.
+
+bindgen will be installed automatically by Cargo, but rustfmt will currently only run on nightly. Therefore you'll need to install rustup and then do the following to install rustfmt:
+
+```sh
+rustup component add rustfmt-preview --toolchain=nightly
+```
+
+rustfmt will be automatically invoked by the build script (`build.rs`).
+
+[bindgen]: https://github.com/rust-lang-nursery/rust-bindgen
+[rustfmt]: https://github.com/rust-lang-nursery/rustfmt
